2
我最近面临一个问题,我无法通过:我如何获得项目的插槽?从ItemStack获得物品插槽
比方说,我的代码看起来像
ItemStack[] items = inv.getContents();
for (ItemStack item : items) {
if (item != null) {
if (position < 27 && position > -1) {
SOMETHING HERE LIKE ---> item.getRawSlot()
}
} else {
}
}
但这种方法getRawSlot()是无效的项目类,我能做些什么?
执行'ItemStack.getRawSlot()'。 – saka1029
你在说你需要知道'item'是否在'items [0]','items [342]'等中? –