-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major
-
None
-
Affects Version/s: None
-
Environment:
Irrelevant
In 1.8, the ItemFrame entity class is bugged as there is no way to remove an item. previously, you had to set the item to null or air, and that would remove it, and after looking at the decompiled code, it seems like that has not changed (and it shouldn't have). So I have come to the conclusion that it is a bug. I have tried setting he item to null or air ( new ItemStack(Material.AIR); ), but the item stays in the ItemFrame and nothing happens (no stacktrace). I have tried removing many types of items and none were removed.
However, I am able to change the item in the ItemFrame to something else. This can be explained by looking at the CraftItemFrame class in craftbukkit.
CraftItemFrame.java
public void setItem(ItemStack item) { if ((item == null) || (item.getTypeId() == 0)) { getHandle().getDataWatcher().add(2, 5); getHandle().getDataWatcher().update(2); } else { getHandle().setItem(CraftItemStack.asNMSCopy(item)); } }