当一个物品为不可消耗的物品时 但是物品包含config中的lore 右键后此物品数量-1
请问一下这段该怎么写
请问一下这段该怎么写
不可消耗?比如说非食物是吗以下代码不规范【用手机打的不方便
相当于思路自己补充
ItemStack item ...玩家手上的东西
如果item.getItemMeta.getLore.contains(你config里的东西)
Item newItem = item
如果newItem的数量大于一
newItem.setAmount(newItem.getAmount - 1)
如果等于一
newItem = 实例化ItemStack AIR
p.setItemInHand(newItem)
相当于思路自己补充
ItemStack item ...玩家手上的东西
如果item.getItemMeta.getLore.contains(你config里的东西)
Item newItem = item
如果newItem的数量大于一
newItem.setAmount(newItem.getAmount - 1)
如果等于一
newItem = 实例化ItemStack AIR
p.setItemInHand(newItem)