Bettermodel Definition
A BetterModel entity definition
字段
| 字段 | 类型 | 默认值 | 描述 | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sound | Var<Sound> | EMPTY | — | ||||||||||||||||||||||||||||||||||||||||||||
data | List<Ref<EntityData<*>>> | empty | — | ||||||||||||||||||||||||||||||||||||||||||||
modelId | Var<String> | — | The BetterModel model ID to use | ||||||||||||||||||||||||||||||||||||||||||||
named | Var<Boolean> | false | Whether the entity should display a nametag | ||||||||||||||||||||||||||||||||||||||||||||
defaultAnimationSettings | DefaultAnimationSettings | — | Default animation settings for the entity
|
| 字段 | 类型 | 默认值 | 描述 |
|---|---|---|---|
walkAnimation | Boolean | true | Run the default walk animation if the entity is moving |
idle | Var<String> | idle | The idle animation to play when the entity is not moving |
walk | Var<String> | walk | The walk animation to play when the entity is moving |
attack | Var<String> | attack | The attack animation to play when the entity swings its arm |
hurt | Var<String> | hurt | The hurt animation to play when the entity takes damage |
strafe | Var<String> | strafe | The strafe animation to play when the entity moves sideways |
jump | Var<String> | jump | The jump animation to play when the entity leaves the ground |
fly | Var<String> | fly | The flying animation to play when the entity is airborne |
interact | Var<String> | interact | The interact animation to play when the entity is interacted with |
hitboxYOffset | Double | -1.6 | Y offset applied to bone hitbox interaction entities (client-side positioning) |
focusOffsetVectorheadLightVar<Int>0hitboxesList<BoneHitbox>emptyBoneHitbox(7)
| 字段 | 类型 | 默认值 | 描述 |
|---|---|---|---|
boneName | String | — | — |
width | Float | 0.5 | — |
height | Float | 0.5 | — |
scale | Float | 1.0 | — |
offsetX | Double | 0.0 | — |
offsetY | Double | 0.0 | — |
offsetZ | Double | 0.0 | — |
nameOffsetDouble2.3showDisplayNameBooleantrueTypeWriter 通用字段(displayName)
| 字段 | 类型 | 默认值 | 描述 |
|---|---|---|---|
displayName | Var<String> | — | — |
How to use it
modelIdis the name of a model loaded by BetterModel. If it is not found the extension falls back to a model namedsteve, and logs a warning.namedshowsdisplayNameabove the model as floating text, with the interaction indicator above it.nameOffset(default2.3) is its height andshowDisplayNamecan hide the name while keeping the indicator.defaultAnimationSettingsmaps entity states to animation names:idle,walk(only used whenwalkAnimationis on),strafe,jump,fly,attack,hurtandinteract. Theinteractanimation plays when a player clicks the entity; leave it empty to play nothing.focusOffsetmoves the point other systems look at (for example look-at),headLightadds a fake light block above the head (0 disables it), andhitboxesbinds click boxes to bones.dataaccepts the generic entity data entries plus the BetterModel ones. Vanilla data that has no equivalent on a 3D model (poses, mob variants…) is ignored with a one-time log warning.