Tags
Creators
Details
1.0.3
Compatibility
Changes
-
Command Arguments Added:
- The
customgivecommand now accepts two arguments:block_or_item: Expects a string representing the block or item name.amount: Expects an integer representing the amount of the custom item to give.
- This change allows for more flexibility in specifying the custom item and its quantity.
- The
-
Item Mapping Method Added:
- Added
getItemByNamemethod to map item names (block_or_item) to their respectiveIteminstances. - This method takes the lowercase item name as input and returns the corresponding
Itemobject. - The mapping includes several default items like "stone," "diamond," "iron_ingot," and others.
- Added
-
Usage of Block/Item Name and Amount:
- The
giveCustomItemFromClipboardmethod now takesblockOrItemandamountparameters to determine which item to create and how many to give.
- The
-
Error Message Update:
- In case of invalid NBT data or an unrecognized block/item name, the error message has been updated to "Invalid NBT data or block/item name."
-
ItemStack Amount:
- The
createItemStackFromNBTmethod now sets the amount of theItemStackbased on theamountparameter passed to it.
- The
-
Expanded Item Mapping:
- The
getItemByNamemethod includes a switch-case block that covers a variety of common items. You can extend this mapping as needed to support more items.
- The
These changes enhance the functionality and configurability of the customgive command, making it more versatile for giving custom items in the game.
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:dFlIz2C3:u2iQyPCY"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:dFlIz2C3:u2iQyPCY"
}

