1. Wiki
  2. /Entities
  3. /minecraft:behavior.drop_item_for

minecraft:behavior.drop_item_for

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

Overview

minecraft:behavior.drop_item_for is an entity component: it goes in the components object of a custom mob, or in one of its component groups. AI goal that makes the mob walk up to a target and drop an item near it, like a cat leaving a gift for a sleeping player. Needs a navigation component.

Fields

FieldTypeDefaultDescription
seconds_before_pickupnumber0Seconds before the dropped item can be picked up.Range: 0 to …
cooldownnumber0.25Seconds to wait before the goal can run again.Range: 0 to …
drop_item_chancenumber1Chance that the mob actually drops an item. 1.0 means 100%.Range: 0 to 1
offering_distancenumber1How far from the target the mob likes to stand when dropping.Range: 0 to …
minimum_teleport_distancenumber2If the target spot is farther than this, the mob teleports there.Range: 0 to …
max_head_look_at_heightnumber10Highest point the mob looks up to while dropping the item.Range: 0 to …
target_rangevec3[1,1,1]Size of the box, in blocks, searched for a target.
teleport_offsetvec3[0,1,0]X, Y and Z shift added to the spot when the mob teleports.
time_of_day_rangeFloatRange{"max":1,"min":0}Times of day the goal can run. 0.0 is noon, 0.25 sunset, 0.5 midnight, 0.75 sunrise.
loot_tablestring""Loot table that picks the dropped item.
on_drop_attemptActorDefinitionTrigger{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}Event that fires when the mob tries to drop an item.
entity_typesEntityTypesnoneWhich entities can receive the item.
search_rangeinteger0How far sideways, in blocks, the mob looks for a spot to go.
search_heightinteger1How far up and down, in blocks, the mob looks for a spot to go.
goal_radiusnumber0.5How close the mob must get to count as arrived, which stops it jittering around the spot.
search_countinteger0How many random blocks are checked each tick. 0 checks every block in range.Range: 0 to …
speed_multipliernumber1Speed multiplier while moving to the target.Range: 0 to …
priorityinteger0Lower numbers run first: when two goals compete, the one with the smaller priority wins.Range: 0 to …
control_flagsGoal's control flags[]noneWhich body parts this goal takes over (move, look, jump), so goals using the same parts cannot run together.

Example

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

BP/entities/<name>.json
{
  "minecraft:behavior.drop_item_for": {
    "seconds_before_pickup": 0,
    "cooldown": 0.25,
    "drop_item_chance": 1,
    "offering_distance": 1,
    "minimum_teleport_distance": 2,
    "max_head_look_at_height": 10,
    "target_range": [
      1,
      1,
      1
    ],
    "teleport_offset": [
      0,
      1,
      0
    ]
  }
}

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