Cosmetic Definition
Define a 3D Cosmetic
Champs
| Champ | Type | Par défaut | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cosmeticId | String | — | Unique cosmetic identifier | ||||||||||||||||||||||||
permission | String | — | Permission required to unlock (player must have this permission) | ||||||||||||||||||||||||
priority | Int | 0 | Display priority in menu (lower = displayed first) | ||||||||||||||||||||||||
category | String | Misc | Category for this cosmetic (e.g., 'Backpack', 'Hat'). Used for menu grouping. | ||||||||||||||||||||||||
model | Ref<EntityDefinitionEntry> | — | The 3D model entity to display. | ||||||||||||||||||||||||
itemModel | String | — | Optional 1.21.4+ item_model key. When set with applicable items, this cosmetic replaces the model on the real ItemStack instead of spawning an entity. | ||||||||||||||||||||||||
applicableItems | List<Item> | empty | Item types that can receive itemModel. An empty list keeps this definition as a free cosmetic. | ||||||||||||||||||||||||
applicableCraftEngineIds | List<String> | empty | CraftEngine item ids that can receive itemModel, e.g. `armors:enderite_helmet`. Checked before applicableItems. | ||||||||||||||||||||||||
equipmentAssetId | String | — | Cle d'apparence portee (composant equippable), ex. `armors:enderite`. Vide = ne touche pas a l'equipement. | ||||||||||||||||||||||||
rotationMode | RotationMode | RELATIVE_TO_BODY | Rotation mode for the cosmetic.Valeurs :RELATIVE_TO_BODYRELATIVE_TO_HEADFIXED | ||||||||||||||||||||||||
offset | Vector | ZERO | Offset from the player's position. | ||||||||||||||||||||||||
rotationOffset | Vector | ZERO | Rotation offset (X=Pitch, Y=Yaw, Z=Roll) applied to the cosmetic. | ||||||||||||||||||||||||
particles | List<CosmeticParticleConfig> | empty | Particle effects attached to this cosmetic.
|
| Champ | Type | Par défaut | Description |
|---|---|---|---|
type | Particle | FLAME | Type of particle. |
offset | Vector | ZERO | Offset from the cosmetic's center. |
count | Int | 1 | Number of particles to spawn. |
speed | Double | 0.0 | Speed of the particles. |
interval | Int | 5 | Interval in ticks between particle spawns. |
menuIconItemcustomDataMap<String, String>emptyHow to use it
A definition is one of two kinds, decided by its fields:
- Entity cosmetic —
modelpoints to an entity definition (an item display, a BetterModel model…).rotationModeisRELATIVE_TO_BODY(backpacks, wings),RELATIVE_TO_HEAD(hats, glasses) orFIXED.offsetandrotationOffset(X pitch, Y yaw, Z roll) position it, andparticlesadd effects, each withtype,offset,count,speedand anintervalin ticks. - Item cosmetic — set
itemModel(anamespace:pathkey) and/orequipmentAssetId(for worn armor, for examplearmors:enderite), and list the items it applies to inapplicableCraftEngineIds(checked first) orapplicableItems. The item keeps its model until the cosmetic is removed, then it is restored.equipmentAssetIdis only applied to items that already have an equippable component, so a sword is left alone.
category must match the ID of a Cosmetic Category entry. A player can wear one cosmetic per category. A player can equip a cosmetic when its permission is empty (it is then free for everyone), when they hold the permission, or when it was unlocked with /tw cosmetics give <player> <entry id> or from another entry. Cosmetics they cannot equip stay visible in the menu but inert.
priority sorts the menu, the lowest first. customData is not used by the extension.