![]() ![]() Sponge.getRegistry().getType(ItemType.class, "minecraft:coal") This is easy to get for modded and none modded items and blocks. This method relies on the fact you have the ItemType of the item. ItemStack stack = ItemStack.builder().fromContainer(cont).build() DataContainer cont = ().toContainer() Ĭont.set(DataQuery.of("UnsafeDamage"), 1) //the 1 is the sub id The example is once again for charcoal, but you can modify it for your own use. Here is one I just tried doing that works, it uses Sponge code only so hopefully there isnt too many issues down the line. ![]() However because most mods didnt go this route and sponge does support the route they went, it means that developers have done things that Sponge doesnt support, meaning that it may cause issues down the line. ItemStackSnapshot snapshot = ().with(Keys.COAL_TYPE, CoalTypes.CHARCOAL).get() So for example if I wanted to get charcoal I would do the following. Therefore for Vannila items (and mods that support the newer way) you use keys to set the “id” of the item. ![]() Sponge doesnt support anything that is deprecated within minecraft, which includes the id system. In minecraft the id values were set to deprecated around minecraft 1.8, so mods should have followed and used the replacement, it seems only Sponge understood this. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |