I’m currently working on a plugin that prompts a user for an item. I want them to be able to type in the numerical value of that item. (ie 5 = wood planks, or 5:4 = acacia wood planks).
Do I have to create a map that maps each item to a standard id? (ie 17 => minecraft:log)
Or is there a way to do this through Sponge? I’m using SpongeVanilla.
I don’t believe so. an ItemStack does not hold the numerical id of the item accept for the unsafe damage value for item variants like color and wood. Curious of your reasoning for this?
Minecraft doesn’t use numerical IDs anymore, at least not publicly. If you’re just looking to be able to get an ItemType from a command, you can use GenericArguments.catalogType.
I sort have figured it out. The only issue is that it seems like you have to type something like “minecraft:log” in, in order to get an item. Instead of using number values or strings.
Since the way I want this to work doesn’t seem possible with the current configuration of Minecraft. I think I’m just going to make a file that is stored as a sort of config that maps all the integer and string values to a Minecraft ID. This will also make items user customizable so they can have their own names or ids for items.
Unless there is a better way to go about doing this. I’m open to suggestions. Thank you @TrenTech & @pie_flavor
I wasn’t aware that they weren’t a thing. I’m making a shop plugin, I started one for spigot, but noticed how well sponge was coming along so I decided to use this instead.
I just think it’s much nicer for a player to be able to browse a shop, have the item name, id, and price displayed to them. Then they could just use the id or name to purchase the item. numerical ID was always the quickest, nicest looking option.
EDIT: I think I found a solution that would work even better than numerical IDs. I really appreciate the help from the three of you!
Anyway, if I were making a sign shop plugin, I’d use a command to create the sign, and have the actual shop info on the sign as NBT. Then the sign can say whatever you want.