Skip to main content

Give (Entity Action Type)

Gives the entity an item stack by putting it in its inventory. If there is no room, the stack drops on the ground.

Type ID: apoli:give

Fields

FieldTypeDefaultDescription
stackItem StackrequiredThe item stack to give.
item_actionItem Action TypeoptionalRuns on the item stack before it is given.
preferred_slotStringoptionalThe slot to try first: "chest", "feet", "head", "legs", "mainhand" or "offhand".

Examples

"entity_action": {
  	"type": "apoli:give",
  	"stack": {
	  "item": "minecraft:egg",
	  "amount": 3
  	}
}

This gives the entity 3 eggs.

"entity_action": {
    "type": "apoli:give",
    "stack": {
        "item": "minecraft:iron_axe"
    },
    "item_action": {
        "type": "apoli:damage",
        "amount": 20,
        "ignore_unbreaking": true
    },
    "preferred_slot": "offhand"
}

This gives the entity an iron axe with a Damage value of 20, put in the offhand slot if possible.