NPCs
Internal
Name | Type | Info |
---|---|---|
code | string | Full type name for the ModNPC -extending class to be used for this NPC.Default: {internalName}.NPCs.{filename} |
netAlways | bool | Whether this NPC should always be synced in multiplayer. Default: false |
Informative
Name | Type | Info |
---|---|---|
displayName | string | NPC name in-game. |
occupation | string | The type of town NPC this NPC is. Default: current JSON filename |
value | int int[1-4] | NPC's value (also the average amount of copper coins it drops). "value": 105099 - 10g 50s 99c"value": [2,20,9,3] - 2p 20g 9s 3c
|
Stats
Name | Type | Info |
---|---|---|
lifeMax | int | The maximum amount of life for this NPC. |
damage | int | The amount of damage dealt by the NPC. Default: 0 |
defense | int | The amount of defense had by the NPC. Default: 0 |
knockbackResist | float | The amount of resistance to knockback the NPC has. Default: 1 |
critChance | int | The chance of the NPC performing a critical strike, in percent. Default: 0 |
critMult | float | The damage multiplier when the NPC performs a critical strike. Default: 2 |
Appearance
Name | Type | Info |
---|---|---|
texture | string | Path to the texture used by this NPC, not including file extension. Default: current JSON filename |
size | int[2] | NPC size in pixels. width and height properties can be used instead. |
width | int | NPC width in pixels. size property can be used instead. |
height | int | NPC height in pixels. size property can be used instead. |
scale | float | A scale multiplier to be used by the NPC. Default: 1 |
frameCount | int | The amount of frames used in this NPC's texture. Default: 1 |
animationStyle | int | The animation style used by this NPC. |
behindTiles | bool | Whether or not the NPC is drawn behind tiles. Default: false |
color | int[3] int[4] | The color to tint the NPC's texture, in RGB or RGBA format. "color": [255,255,255] - white"color": [255,0,0,127] - red, half-transparentDefault: [255,255,255] |
alpha | int | The transparency of the NPC, where 0 is opaque, and 255 is invisible. Default: 0 |
Interface
Name | Type | Info |
---|---|---|
textureHead | string | Used only by town NPCs. Path to the head texture used by this NPC, not including file extension. Default: {texture}._Head |
shop | bool | Whether this Town NPC has a shop. Default: false |
showHealthBar | bool | Whether to show the health bar above the NPC. Default: true |
lifeBarScale | float | A scale multiplier used by the NPC's life bar. Default: 1 |
realLifeHealthBar | bool | Whether or not to use the realLife value for the health bar, used for multipart NPCs.Default: false |
Gameplay
Name | Type | Info |
---|---|---|
npcSlots | float | The amount of spawn slots this NPC takes up, the higher the value, the less other NPCs can spawn. Default: 1 |
aiStyle | int | The AI used by this NPC. |
friendly | bool | Whether this NPC is friendly. Default: false |
townNPC | bool | Whether this NPC is a town NPC. Default: false |
male | bool | Whether this Town NPC is male or female. |
boss | bool | Whether this NPC is a boss. Default: false |
dontTakeDamage | bool | Whether the NPC is immune to damage. Default: false |
lavaImmune | bool | Whether the NPC is immune to lava damage. Default: false |
noGravity | bool | Whether the NPC is unaffected by gravity. Default: false |
noTileCollide | bool | Whether the NPC can pass through tiles. Default: false |
buffImmune | <string/int>[?] | An array of buff names and types that this NPC is immune to. |
soundHit | int string | The hit sound used by this NPC. "soundHit": 12 - vanilla sound 12 (Space Gun)"soundHit": "MySound" - custom sound filename without the extension
|
soundKilled | int string | The death sound used by this NPC. "soundKilled": 12 - vanilla sound 12 (Space Gun)"soundKilled": "MySound" - custom sound filename without the extension
|
music | string | The name of the music to play when this NPC is on screen. |
drops | object[?] | An array of items this NPC can drop. |
coldDamage | bool | Wether or not the damage this npc causes should be considered 'cold' damage. (Used to reduce damage with the warmth potion). Default: false |
collisonFallThrough | bool | Wether or not the this npc falls through platforms. (Only used by npcs using zombie AI (aiStyle 3)). Default: false |