Eric12324
如何通过一个string来创建itemStack?例如“minecraft:mutton”


海螺螺
String id = "minecraft:mutton";
ItemType type = Sponge.getRegistry().getType(ItemType.class, id).get();
ItemStack stack = ItemStack.of(type);

你走以后
.....................

Eric12324
海螺螺 发表于 2020-2-11 15:47
String id = "minecraft:mutton";
ItemType type = Sponge.getRegistry().getType(ItemType.class, id).get ...

谢谢版主!我一开始就用的这个方法,怎么弄都报错,最后发现是node路径写错了

第一页 上一页 下一页 最后一页