如何通过一个string来创建itemStack?例如“minecraft:mutton”
String id = "minecraft:mutton";
ItemType type = Sponge.getRegistry().getType(ItemType.class, id).get();
ItemStack stack = ItemStack.of(type);
ItemType type = Sponge.getRegistry().getType(ItemType.class, id).get();
ItemStack stack = ItemStack.of(type);
.....................
海螺螺 发表于 2020-2-11 15:47
String id = "minecraft:mutton";
ItemType type = Sponge.getRegistry().getType(ItemType.class, id).get ...
谢谢版主!我一开始就用的这个方法,怎么弄都报错,最后发现是node路径写错了
