Skip to content

Entities

The entity system supports animals, enemies, wandering, chasing, melee attacks, health, damage reactions, and drops.

Main Scripts

Assets/PixitGames/BlockWorld/Scripts/EntityHealth.cs
Assets/PixitGames/BlockWorld/Scripts/EntityMovement.cs
Assets/PixitGames/BlockWorld/Scripts/EntityTargeting.cs
Assets/PixitGames/BlockWorld/Scripts/EntityWander.cs
Assets/PixitGames/BlockWorld/Scripts/EntityChase.cs
Assets/PixitGames/BlockWorld/Scripts/EntityMeleeAttack.cs
Assets/PixitGames/BlockWorld/Scripts/EntityDrop.cs

Prefabs

Enemy and character prefabs live under:

Assets/PixitGames/BlockWorld/Prefabs/Characters

Animal prefabs live under:

Assets/PixitGames/BlockWorld/Prefabs/Animals

Common Entity Components

Component Purpose
EntityHealth Health, death, hit flash, death animation
EntityMovement Rigidbody-based movement and animation speed
EntityTargeting Finds a target, usually the player
EntityWander Random wandering when not chasing
EntityChase Chase behavior toward target
EntityMeleeAttack Close-range attack logic
EntityDrop Drops block/item/tool rewards on death

Biome Spawning

Entities spawn from biome rules. Add spawn entries to:

BiomeData.entitySpawns

Each spawn entry can control count, chance, placement, yaw, and distance rules.

Combat

The player attacks entities through BlockInteractor. Damage comes from:

  • Weapon item damage
  • Tool damage fallback
  • Unarmed damage fallback

Entities can drop rewards through EntityDrop.