First of all, you have to know theese two words:
Actions and
Requirements.
Actions
These are things that executed when all requirements is met.
Command Action | Executes a command. | type:
COMMAND
Required entry: '
command' | String
DropAction | Drops an item at entity's location. | type:
DROP
Required entry:
'item' | XItemStack
GiveAction | Gives item to killer. | type:
GIVE
Required entry:
'item' | XItemStack
Requirements
These are required scenarios to run actions.
ChanceRequirement | Chance. | type: CHANCE
Supports any double between 0.0 and 100.0
Required entry:
'chance' | Double
TypeRequirement | Entity's type should equal to this. | type: TYPE
Click here for list of all entity types.
Required entry:
'entityType' | EntityType
NameRequirement | Entity's name should equal to this. | type: NAME
Supports any double between 0.0 and 100.0
Required entry:
'name' | String
Examples
Code (Java):
requirements
:
typeCheck
:
type
: TYPE
entityType
: ZOMBIE
nameCheck
:
type
: NAME
name
:
"hombie"
- It will check is entity's type equal to ZOMBIE.
- Then it will check is entity's name to "hombie".
If above requirements are met, below actions will be executed.
Code (Java):
actions
:
dropStick
:
type
: DROP
item
:
material
: STICK
giveDiamond
:
type
: GIVE
item
:
material
: DIAMOND
amount
:
3
name
:
"§bSpecial Diamond!!"
- It will drop a STICK
- It will give the special diamond to killer.
Note: You can use "§" instead of "&" for colorizing.