Skip to content

Vanilla items & mobs

Daniel Saukel edited this page Aug 12, 2018 · 2 revisions

See also: Categorizable

The VanillaItem and VanillaMob classes represent one type of a vanilla item or mob.

What exactly is a VanillaItem / VanillaMob?

As of 1.13, a Material enum value is considered one vanilla item.

Before 1.13, each data value of the same material is considered an item if it is not a damage value. For example: "351:4" has its instance of VanillaItem because it represents lapis lazuli, which used to be a variation of the dye (or ink sac) material. However, the data value of "267:4" just determines the durability of the iron sword and is not considered an own vanilla item.

As of 1.13, an EntityType enum value is considered one vanilla mob.

Before 1.13, each enum value and each of its variants is considered one vanilla mob.

How to get a VanillaItem / VanillaMob

VanillaItem.values() returns a Collection of all vanilla items. This collection includes items that do not exist in the version that the server is running; it will, for example, contain the shield if the server runs 1.8.

VanillaItem.getLoaded() return just the vanilla items that are loaded in the current environment.

CaliburnAPI#getExItem(org.bukkit.inventory.ItemStack) returns the type of the ItemStack as an ExItem.

CaliburnAPI#getExItem(Object) handles numeric and String IDs and returns the respective ExItem.

The same methods exist for mobs as well.