1

I'm working on a big spigot plugin with a menu made with an inventory, and in this inventory, I add wools like choices for the player.

I use the following line to create my ItemStack:

ItemStack i = new ItemStack(Material.WOOL);

But I have the following error since spigot was updated in 1.13:

WOOL cannot be resolved or is not a field

Does someone know why, and how to update through the correct way?

4

1 回答 1

1

在 Spigot 1.13 中,材质略有不同,每种颜色的羊毛都有自己的名称。

更多信息:Spigot 文档


例如,如果您需要白色羊毛(它是 的默认颜色Material.WOOL),您将需要Material.WHITE_WOOL,并且您的代码将是:

ItemStack i = new ItemStack(Material.WHITE_WOOL);

于 2018-09-30T21:43:13.300 回答