Skip to content

Binding Slots to Entities

It is required that each Slot created needs to be implicitly bound to the desired entity type. By default, the given implemented slots are bound to any entity type found within the accessories:defaulted_targets EntityType tag which currently includes the Player and ArmorStand type.

Data Pack Format

To bind a slot to a given EntityType you will need to create a .json file at the following location: data/{replace_with_pack_namespace}/accessories/entity/. This file will need to contain to required fields: entities and slots.

Field Keys
Data Type Description
"entities" String[] A list containing either specific resource locations of Entity Types or an Entity Type Tag (prefixed with a hashtag #)
"slots" String[] A list of all slot names to be available to the given entities

The example below is what Accessories uses to bind the Builtin Slots to the defaulted entity targets:

{
  "replace": false,
  "entities": [
    "#accessories:defaulted_targets"
  ],
  "slots": [
    "hat",
    "face",
    "necklace",
    "cape",
    "back",
    "hand",
    "ring",
    "wrist",
    "belt",
    "anklet",
    "shoes",
    "charm"
  ]
}

Last update: 2024-12-25