The Entity system is the core of interactive objects in Voxel Playground. All interactive items, weapons, characters, and destructible objects inherit from the Entity base class.
Understanding the hierarchy helps in choosing the right base class for your mod:
Entity: Base class. Handles team flags (TeamFlag), freeze state, and basic identity.
EntityItem: Adds cached rigidbody access plus grab/ungrab callbacks.
EntityAttachmentItem: Base for items that can be equipped or physically attached. This is the real shared base for most weapons and tools.
EntityDestructibleItem: Destructible carried / scene items.EntityBuildingElement: Construction parts with attachment / snapping logic.EntityFirableWeapon: Base for weapons or tools that expose trigger / ability input, ammo-like state, firePoint, and reload helpers.
EntityHoldWeapon: Hold-to-fire / continuous activation pattern.
EntityGunItem: Standard projectile gun base.EntityToggleWeapon: Press-to-toggle pattern.EntityCharacter: Complex class for AI and Player characters (Health, State Machine, Ragdoll).Notes:
EntityGunItem. Specialized weapons such as gravity / linker / saber style tools may derive directly from EntityFirableWeapon.EntityItem currently lives under the Weapons folder in code, even though it is used as a broader pickup-item base.For simple melee objects (like a bat or hammer), use EntityAttachmentItem.
EntityAttachmentItem component.GripPoint exists or assign the gripPoint field.For sharp weapons (swords, knives), use EntityAttachmentItem + BladeTrigger.
BladeTrigger: Handles slicing, stabbing, and voxel destruction.
Sharpness: Determines penetration depth.CutHardnessCap: Max hardness the blade can cut (e.g., PointDataV2.HardnessCap_Sword).DamageVoxel: If true, it destroys voxels on hit.EnableSliceOut: Allows the blade to slide out of the target.Use EntityGunItem for conventional guns. Use EntityFirableWeapon directly when the item still uses weapon input semantics but is not a normal projectile gun.
FirePoint: Transform where bullets spawn.MagAmmo: Total ammo capacity.ReloadTime: Time to reload.WindUpTime: Delay before the first shot (e.g., minigun spin-up).AttackRange: Max range for AI usage.EntityHoldWeapon: fires or updates while trigger is held / active.EntityToggleWeapon: trigger press toggles active state.EntityGunItem: handles projectile spawning, spread, recoil, muzzle FX, casing.Characters are handled by EntityCharacter, but modders should use CharacterPresetProxy to configure them.
CharacterPresetProxy:
EnemyInfo: Stats and configuration.CharacterSize: Standard (Human), Large (Orc), etc.CharacterAIBehavior: ZombieNormal, SoldierLv1, etc.VoxelObjectProxy for Head, Chest, Limbs, etc.GripPoint:
"GripPoint".FirePoint:
EntityFirableWeapon.InfoPose:
"InfoPose".When creating custom weapons (usually inheriting EntityFirableWeapon), these are the stable input extension points:
| Method | VR Controller | Flatscreen (Mouse/Keyboard) |
|---|---|---|
OnTriggerPressed |
Trigger Button | Left Mouse Button |
OnTriggerReleased |
Trigger Release | Left Mouse Release |
OnAbilityLongPressed |
Hold A/X | Hold ability key |
OnAbilityReleased(float pressedTime) |
Release A/X | Release ability key |
Notes:
OnAbilityPressed() base hook in the current weapon hierarchy.Activate() / Deactivate() is the runtime state switch, while trigger callbacks only decide when to enter or leave that state.