メインコンテンツまでスキップ

Cosmetic Definition

Define a 3D Cosmetic

フィールド

フィールド型デフォルト説明
cosmeticIdString—Unique cosmetic identifier
permissionString—Permission required to unlock (player must have this permission)
priorityInt0Display priority in menu (lower = displayed first)
categoryStringMiscCategory for this cosmetic (e.g., 'Backpack', 'Hat'). Used for menu grouping.
modelRef<EntityDefinitionEntry>—The 3D model entity to display.
itemModelString—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.
applicableItemsList<Item>emptyItem types that can receive itemModel. An empty list keeps this definition as a free cosmetic.
applicableCraftEngineIdsList<String>emptyCraftEngine item ids that can receive itemModel, e.g. `armors:enderite_helmet`. Checked before applicableItems.
equipmentAssetIdString—Cle d'apparence portee (composant equippable), ex. `armors:enderite`. Vide = ne touche pas a l'equipement.
rotationModeRotationModeRELATIVE_TO_BODYRotation mode for the cosmetic.値:RELATIVE_TO_BODYRELATIVE_TO_HEADFIXED
offsetVectorZEROOffset from the player's position.
rotationOffsetVectorZERORotation offset (X=Pitch, Y=Yaw, Z=Roll) applied to the cosmetic.
particlesList<CosmeticParticleConfig>emptyParticle effects attached to this cosmetic.
CosmeticParticleConfig(5)
フィールド型デフォルト説明
typeParticleFLAMEType of particle.
offsetVectorZEROOffset from the cosmetic's center.
countInt1Number of particles to spawn.
speedDouble0.0Speed of the particles.
intervalInt5Interval in ticks between particle spawns.
menuIconItem—Item representation in the menu.
customDataMap<String, String>emptyCustom data for specific implementations.

How to use it​

A definition is one of two kinds, decided by its fields:

  • Entity cosmetic — model points to an entity definition (an item display, a BetterModel model…). rotationMode is RELATIVE_TO_BODY (backpacks, wings), RELATIVE_TO_HEAD (hats, glasses) or FIXED. offset and rotationOffset (X pitch, Y yaw, Z roll) position it, and particles add effects, each with type, offset, count, speed and an interval in ticks.
  • Item cosmetic — set itemModel (a namespace:path key) and/or equipmentAssetId (for worn armor, for example armors:enderite), and list the items it applies to in applicableCraftEngineIds (checked first) or applicableItems. The item keeps its model until the cosmetic is removed, then it is restored. equipmentAssetId is 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.