Skip to content

NPC Model Definitions

NPC model definitions configure the visual appearance, hitbox, animations, and camera behavior for NPCs. These server-side JSON files link to client-side .blockymodel and .blockyanim files.

Model definitions are stored in Assets/Server/Models/:

  • DirectoryAssets/Server/Models/
    • DirectoryBeast/
      • Fox.json
      • Bear_Grizzly.json
      • Wolf.json
    • DirectoryCritter/
      • Rabbit.json
      • Squirrel.json
    • DirectoryIntelligent/
      • Human.json
      • Kweebec.json
    • DirectoryLivestock/
      • Sheep.json
      • Cow.json
    • DirectoryUndead/
      • Skeleton.json
      • Zombie.json

Client-side models and animations are in Assets/Common/NPC/:

  • DirectoryAssets/Common/NPC/
    • DirectoryBeast/Fox/
      • DirectoryModels/
        • Model.blockymodel
        • Texture.png
      • DirectoryAnimations/
        • DirectoryDefault/
          • Idle.blockyanim
          • Walk.blockyanim
          • Run.blockyanim
        • DirectoryDamage/
          • Hurt.blockyanim
          • Death.blockyanim
        • DirectorySwim/
        • DirectoryFly/
        • DirectoryFlavor/
FieldTypeDescription
ModelstringPath to .blockymodel file
TexturestringPath to texture .png file
HitBoxobjectCollision box dimensions
AnimationSetsobjectAnimation mappings by state
FieldTypeDefaultDescription
EyeHeightfloat-Height of eyes from ground (blocks)
CrouchOffsetfloat0Vertical offset when crouching
MinScalefloat0.95Minimum random scale multiplier
MaxScalefloat1.05Maximum random scale multiplier
DefaultAttachmentsModelAttachment[]nullAttachments always applied to this model
RandomAttachmentSetsmap<string, map<string, ModelAttachment>>nullWeighted random attachment pools per slot
"HitBox": {
"Min": { "X": -0.45, "Y": 0, "Z": -0.45 },
"Max": { "X": 0.45, "Y": 1.1, "Z": 0.45 }
}
FieldTypeDescription
MinVector3Minimum corner (bottom-back-left)
MaxVector3Maximum corner (top-front-right)

Controls head tracking for the NPC:

"Camera": {
"Pitch": {
"AngleRange": { "Max": 45, "Min": -45 },
"TargetNodes": ["Head"]
},
"Yaw": {
"AngleRange": { "Max": 45, "Min": -45 },
"TargetNodes": ["Head"]
}
}
FieldTypeDescription
AngleRange.MaxfloatMaximum rotation angle (degrees)
AngleRange.MinfloatMinimum rotation angle (degrees)
TargetNodesstring[]Bones to rotate for head tracking

For UI icon generation:

"IconProperties": {
"Scale": 0.6,
"Rotation": [0.0, -45.0, 0.0],
"Translation": [19.0, -41.0]
}

Attachments are extra model+texture pairs layered on top of the base NPC model — think armor pieces, accessories, hairstyles, or held items. The system supports both fixed attachments that always appear and randomized attachments that vary per NPC spawn.

Each attachment entry has these fields:

FieldTypeDefaultDescription
ModelstringnullPath to the attachment .blockymodel file
TexturestringnullPath to the attachment texture .png file
GradientSetstringnullGradient set for color variation
GradientIdstringnullSpecific gradient within the set
Weightdouble1.0Selection weight (only used in RandomAttachmentSets)

An array of ModelAttachment objects that are always applied to the NPC. These get combined with any randomly selected attachments at spawn time.

"DefaultAttachments": [
{
"Model": "NPC/Intelligent/Human/Attachments/Hair_01.blockymodel",
"Texture": "NPC/Intelligent/Human/Attachments/Hair_01.png"
}
]

A two-level map structure: the outer key is a slot name (like "Hair" or "Armor"), and the inner map contains named attachment options with weights. At spawn, the engine picks one option per slot using weighted random selection.

"RandomAttachmentSets": {
"Hair": {
"Style_A": {
"Model": "NPC/Intelligent/Human/Attachments/Hair_A.blockymodel",
"Texture": "NPC/Intelligent/Human/Attachments/Hair_A.png",
"Weight": 2.0
},
"Style_B": {
"Model": "NPC/Intelligent/Human/Attachments/Hair_B.blockymodel",
"Texture": "NPC/Intelligent/Human/Attachments/Hair_B.png",
"Weight": 1.0
}
}
}

In this example, Style_A is twice as likely to be selected as Style_B. The final attachment list sent to the client is the DefaultAttachments array plus one pick from each RandomAttachmentSets slot.

The AnimationSets object maps animation states to animation files:

"Idle": {
"Animations": [
{
"Animation": "NPC/Beast/Fox/Animations/Default/Idle.blockyanim",
"Speed": 0.6,
"BlendingDuration": 0.1,
"Looping": true,
"SoundEventId": "SFX_Fox_Idle"
}
]
}
FieldTypeDefaultDescription
Animationstring-Path to .blockyanim file
Speedfloat1.0Animation playback speed multiplier
BlendingDurationfloat0.2Transition blend time (seconds)
LoopingbooltrueWhether animation loops
SoundEventIdstring-Sound to play with animation
StateDescriptionTypically Loops
IdleStanding stillYes
WalkWalking forwardYes
WalkBackwardWalking backwardYes
RunRunning forwardYes
CrouchCrouching idleYes
CrouchWalkCrouching forwardYes
CrouchWalkBackwardCrouching backwardYes
StateDescriptionTypically Loops
JumpStart of jumpNo
JumpWalkJump while walkingNo
JumpRunJump while runningNo
FallFalling animationYes
StateDescription
SwimIdleFloating still
SwimSwimming forward
SwimBackwardSwimming backward
SwimFastFast swimming
SwimJumpJumping from water
SwimFloatSurface floating
SwimSinkSinking underwater
SwimDiveDiving downward
SwimDiveBackwardDiving backward
SwimDiveFastFast diving
StateDescription
FlyIdleHovering
FlyFlying forward
FlyBackwardFlying backward
FlyFastFast flying
StateDescription
FluidIdleStanding in fluid
FluidWalkWalking in fluid
FluidWalkBackwardWalking backward in fluid
FluidRunRunning in fluid
StateDescriptionTypically Loops
HurtTaking damageNo
DeathDying on landNo
HurtFlyHurt while flyingNo
DeathFlyDying while flyingNo
DeathFlyImpactGround impact after flying deathNo
HurtSwimHurt while swimmingNo
DeathSwimDying while swimmingNo
HurtDrownHurt from drowningNo
DeathDrownDying from drowningNo
StateDescription
AlertedNoticed threat
SpawnInitial spawn animation
LaydownTransition to sleeping
SleepSleeping loop
WakeWaking up
StateDescription
RoarAggressive roar/howl
ThreatenThreat display
SearchLooking around
EatEating
DigDigging
TiltHeadHead tilt (curiosity)
HowlHowling
Fox.json
{
"Model": "NPC/Beast/Fox/Models/Model.blockymodel",
"Texture": "NPC/Beast/Fox/Models/Texture.png",
"EyeHeight": 0.9,
"CrouchOffset": -0.4,
"HitBox": {
"Max": { "X": 0.45, "Y": 1.1, "Z": 0.45 },
"Min": { "X": -0.45, "Y": 0, "Z": -0.45 }
},
"Camera": {
"Pitch": {
"AngleRange": { "Max": 45, "Min": -45 },
"TargetNodes": ["Head"]
},
"Yaw": {
"AngleRange": { "Max": 45, "Min": -45 },
"TargetNodes": ["Head"]
}
},
"AnimationSets": {
"Idle": {
"Animations": [{
"Animation": "NPC/Beast/Fox/Animations/Default/Idle.blockyanim",
"Speed": 0.6
}]
},
"Walk": {
"Animations": [{
"Animation": "NPC/Beast/Fox/Animations/Default/Walk.blockyanim",
"Speed": 1.4
}]
},
"Run": {
"Animations": [{
"Animation": "NPC/Beast/Fox/Animations/Default/Run.blockyanim",
"SoundEventId": "SFX_Fox_Run",
"Speed": 1.1
}]
},
"Jump": {
"Animations": [{
"Animation": "NPC/Beast/Fox/Animations/Default/Jump.blockyanim",
"BlendingDuration": 0.1,
"Looping": false,
"Speed": 0.8
}]
},
"Hurt": {
"Animations": [{
"Animation": "NPC/Beast/Fox/Animations/Damage/Hurt.blockyanim",
"BlendingDuration": 0.1,
"Looping": false,
"SoundEventId": "SFX_Fox_Hurt"
}]
},
"Death": {
"Animations": [{
"Animation": "NPC/Beast/Fox/Animations/Damage/Death.blockyanim",
"Looping": false,
"SoundEventId": "SFX_Fox_Death"
}]
},
"Sleep": {
"Animations": [{
"Animation": "NPC/Beast/Fox/Animations/Default/Sleep.blockyanim",
"SoundEventId": "SFX_Fox_Sleep"
}]
},
"Alerted": {
"Animations": [{
"Animation": "NPC/Beast/Fox/Animations/Default/Alerted.blockyanim",
"Looping": false,
"SoundEventId": "SFX_Fox_Alerted"
}]
}
},
"IconProperties": {
"Scale": 0.6,
"Rotation": [0.0, -45.0, 0.0],
"Translation": [19.0, -41.0]
}
}

Larger NPCs like bears have different hitbox dimensions and scale ranges:

Bear_Grizzly.json
{
"Model": "NPC/Beast/Bear_Grizzly/Models/Model.blockymodel",
"Texture": "NPC/Beast/Bear_Grizzly/Models/Texture.png",
"EyeHeight": 1.5,
"CrouchOffset": -0.3,
"HitBox": {
"Max": { "X": 0.8, "Y": 1.8, "Z": 0.8 },
"Min": { "X": -0.8, "Y": 0, "Z": -0.8 }
},
"MinScale": 0.9,
"MaxScale": 1.25,
"DefaultAttachments": [],
"AnimationSets": {
"Roar": {
"Animations": [{
"Animation": "NPC/Beast/Bear_Grizzly/Animations/Flavor/Roar.blockyanim",
"Looping": false,
"SoundEventId": "SFX_Bear_Grizzly_Alerted"
}]
},
"Eat": {
"Animations": [{
"Animation": "NPC/Livestock/Sheep/Animations/Flavor/Eat.blockyanim"
}]
}
}
}
CategoryLocationExamples
BeastModels/Beast/Fox, Wolf, Bear, Scarak
CritterModels/Critter/Rabbit, Squirrel, Mouse
IntelligentModels/Intelligent/Human, Kweebec, Feran
LivestockModels/Livestock/Sheep, Cow, Chicken
WildlifeModels/Wildlife/Deer, Boar
UndeadModels/Undead/Skeleton, Zombie, Wraith
Flying_BeastModels/Flying_Beast/Pterodactyl variants
Flying_CritterModels/Flying_Critter/Birds, Insects
Swimming_BeastModels/Swimming_Beast/Shark, Whale
Swimming_WildlifeModels/Swimming_Wildlife/Fish, Jellyfish
ElementalModels/Elemental/Fire, Water, Earth elementals
BossModels/Boss/Boss creatures
PetsModels/Pets/Pet variants
ProjectilesModels/Projectiles/Arrow, Spell projectiles
VehiclesModels/Vehicles/Mounts, Vehicles

Standard animation organization:

  • DirectoryNPC/[Category]/[NPC]/Animations/
    • DirectoryDefault/
      • Idle.blockyanim
      • Walk.blockyanim
      • Walk_Backward.blockyanim
      • Run.blockyanim
      • Jump.blockyanim
      • Fall.blockyanim
      • Crouch.blockyanim
      • Crouch_Walk.blockyanim
      • Alerted.blockyanim
      • Spawn.blockyanim
      • Sleep.blockyanim
      • Laydown.blockyanim
      • Wake.blockyanim
    • DirectoryDamage/
      • Hurt.blockyanim
      • Death.blockyanim
      • Hurt_Fly.blockyanim
      • Death_Fly.blockyanim
    • DirectorySwim/
      • Swim_Idle.blockyanim
      • Swim.blockyanim
    • DirectoryFly/
      • Fly_Idle.blockyanim
      • Fly.blockyanim
    • DirectoryFlavor/
      • Roar.blockyanim
      • Eat.blockyanim
  1. Create the model in Blockbench with proper bone hierarchy
  2. Create animations for each required state
  3. Export .blockymodel and .blockyanim files
  4. Create model definition JSON referencing your files
  5. Create NPC role to define behavior
MyPlugin_CustomCreature.json
{
"Model": "MyPlugin/NPC/CustomCreature/Model.blockymodel",
"Texture": "MyPlugin/NPC/CustomCreature/Texture.png",
"EyeHeight": 1.0,
"HitBox": {
"Max": { "X": 0.5, "Y": 1.5, "Z": 0.5 },
"Min": { "X": -0.5, "Y": 0, "Z": -0.5 }
},
"AnimationSets": {
"Idle": {
"Animations": [{
"Animation": "MyPlugin/NPC/CustomCreature/Animations/Idle.blockyanim"
}]
},
"Walk": {
"Animations": [{
"Animation": "MyPlugin/NPC/CustomCreature/Animations/Walk.blockyanim"
}]
},
"Hurt": {
"Animations": [{
"Animation": "MyPlugin/NPC/CustomCreature/Animations/Hurt.blockyanim",
"Looping": false
}]
},
"Death": {
"Animations": [{
"Animation": "MyPlugin/NPC/CustomCreature/Animations/Death.blockyanim",
"Looping": false
}]
}
}
}