Skip to content

Item Tags

BONNe edited this page Mar 13, 2026 · 1 revision

Item Tags — Allow Items to Attack Blocks

Animal Pen adds three item tags that control which items can attack blocks.

Tag Description
animal_pen:can_attack_aquarium Items that can attack Aquarium
animal_pen:can_attack_pen Items that can attack Animal Pen
animal_pen:can_attack_aviary Items that can attack Aviary

Items inside these tags will work like weapons for the block.

Example — Adding Custom Weapons

We want:

  • mod1_id:custom_knife - item
  • #mod2_id:modded_daggers - item tag

to attack Animal Pen.

Minecraft 1.20.6 and below

Path:

your_custom_datapack/data/animal_pen/tags/items/can_attack_pen.json

Minecraft 1.21+

Path:

your_custom_datapack/data/animal_pen/tags/item/can_attack_pen.json

File:

{
  "replace": false,
  "values": [
    "mod1_id:custom_knife",
    "#mod2_id:modded_daggers"
  ]
}

"replace": false keeps default items and adds yours.
# indicates that it is an item-tag

Clone this wiki locally