Give
Gives the entity an item stack, by inserting it into its inventory or dropping it on the ground if there is no available space.
Type ID: apoli:give
Fields
| Field | Type | Default | Description |
|---|---|---|---|
stack |
Item Stack | The item stack to give to the entity. | |
item_action |
Item Action | optional | If set, executes an item action on the item stack before it's given to the player. |
preferred_slot |
String | optional | If set, this will prioritize the action to put the item in the specified slot. Accepts "chest", "feet", "head", "legs", "mainhand" or "offhand". |
Examples
"entity_action": {
"type": "apoli:give",
"stack": {
"item": "minecraft:egg",
"amount": 3
}
}
Gives the entity a stack of 3 eggs.
"entity_action": {
"type": "apoli:give",
"stack": {
"type": "minecraft:iron_axe"
},
"item_action": {
"type": "apoli:damage",
"amount": 20,
"ignore_unbreaking": true
},
"preferred_slot": "offhand"
}
This example gives the player an iron axe that has a Damage value of 20 that will be preferably put in the offhand slot.