1. Wiki
  2. /Entities
  3. /minecraft:giveable

minecraft:giveable

Don't want to write this by hand? GodCraft sets minecraft:giveable for you with a switch.Get GodCraft

Overview

minecraft:giveable is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Lets players hand certain items to the entity, which takes the item into its inventory and fires an event.

Fields

FieldTypeDefaultDescription
cooldownDecimal"0.0"Seconds to wait between gifts, to stop spam clicking.
itemsListnoneItems the entity accepts.
on_giveStringnoneEvent fired when a correct item is given.

Example

Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):

BP/entities/<name>.json
{
  "minecraft:giveable": {
    "cooldown": "0.0",
    "items": {},
    "on_give": ""
  }
}

We use cookies to improve your experience and analyse site traffic. Learn more