How to add a new Mob Type to Voxel Garden.

[[TOC]]

The Basics

You’ll need the following tools:

  1. a text editor
  2. a sprite editor

We’ll assume:

You will have to edit files in:

PACK/
├── mob_types.cfg
├── mob_models.cfg
└── textures/
    └── NAME.png

PACK/mob_types.cfg

Each section in this file defines the properties of one mob in the world:

[NAME]
size = H V          ; half-size of the mob's collision box in cells
solid = true        ; has collision
persistent = true   ; is saved to disk when unloaded
drop = PACK.NAME    ; drops the PACK.NAME item

PACK/mob_models.cfg

Each section in this file defines how a mob displays, both graphically and audio-wise:

[NAME]
texture.f = NAME_front.png ; uses PACK/textures/NAME_front.png when seen from the front
texture.b = NAME_back.png  ; uses PACK/textures/NAME_back.png when seen from the back

How do I Spawn my Mob

Mobs can’t be stored in an inventory or held in your hand to spawn them; that’s what items do; to make the cell you just made spawnable you’ll want to define an item for it.

Making a Container

Container mobs are made by adding an inventory to them and by setting their interaction type to ‘container’; both of these things are added to PACK/mob_types.cfg:

[NAME]
; other mob properties here
items = N               ; has an inventory with N items
interact = container    ; allows access to its inventory when used