Item item/compare

Item Compare

Compares two ItemStacks for similarity or full equality.

Note: "Similar" uses Bukkit's isSimilar() — matching material, display name, lore, enchantments, and NBT but not amount. "Identical" uses equals() which also checks amount.

Inputs

NameTypeOptionalDescription
item_a item_stack First ItemStack.
item_b item_stack Second ItemStack.

Outputs

NameTypeDescription
similar boolean True if both items are the same type and metadata (ignoring stack size).
identical boolean True if both items are exactly equal including stack size.

Examples

Check if held item matches a required item

Verify a player is holding the correct item type.

  1. Held Item (GET) → item_a → Item Compare
  2. Create Item (IRON_SWORD) → item_b → Item Compare
  3. Item Compare → similar → Branch