Difference between revisions of "NPCs/Properties"

From SupaHam
Jump to: navigation, search
(initial creation.)
 
(Added example of an npc in npcs.yml.)
Line 1: Line 1:
 
=Properties=
 
=Properties=
 
Each NPC must have at least one property in order for them to properly spawn in the world. There are multiple properties to choose from, but the most important two are the location and type property.
 
Each NPC must have at least one property in order for them to properly spawn in the world. There are multiple properties to choose from, but the most important two are the location and type property.
 +
{{example|title=Example of a PIG entity, that spawns at x: 14, y: 75, z: 149 in world 'world', with a persistent nametag called pIggy, when left clicked, and the player has the permission 'let.me.left.click', the command 'say test' is executed by the CONSOLE, and finally apply some vanilla minecraft NBT data to the piggy, making it invulnerable to damage.|text=
 +
<syntaxhighlight lang="yaml">
 +
npcs:
 +
  test:
 +
    type: PIG
 +
    location: world 14 75 149
 +
    name: pIggy
 +
    cmds-left-click: ~say test
 +
    cmds-left-click-perm: let.me.left.click
 +
    mc-nbt: '{Invulnerable:1}'
 +
</syntaxhighlight>
 +
}}

Revision as of 12:46, 7 March 2015

Properties

Each NPC must have at least one property in order for them to properly spawn in the world. There are multiple properties to choose from, but the most important two are the location and type property.

Example: Example of a PIG entity, that spawns at x: 14, y: 75, z: 149 in world 'world', with a persistent nametag called pIggy, when left clicked, and the player has the permission 'let.me.left.click', the command 'say test' is executed by the CONSOLE, and finally apply some vanilla minecraft NBT data to the piggy, making it invulnerable to damage.
npcs:
  test:
    type: PIG
    location: world 14 75 149
    name: pIggy
    cmds-left-click: ~say test
    cmds-left-click-perm: let.me.left.click
    mc-nbt: '{Invulnerable:1}'