minecraft:behavior.drop_item_for

Allows the entity to move toward a target, and drop an item near the target. This goal requires a "minecraft:navigation" to execute.

Properties

PropertyTypeDefaultWhat it does
seconds_before_pickupDecimalmin 00The numbers of seconds that will pass before the dropped entity can be picked up from the ground.
cooldownDecimalmin 00.25Total time that the goal is on cooldown before it can be used again.
drop_item_chanceDecimal0 to 11The percent chance the entity will drop an item when using this goal.
offering_distanceDecimalmin 01The preferred distance the entity tries to be from the target it is dropping an item for.
minimum_teleport_distanceDecimalmin 02If the target position is farther away than this distance on any tick, the entity will teleport to the target position.
max_head_look_at_heightDecimalmin 010The maximum height the entities head will look at when dropping the item. The entity will always be looking at its target.
target_rangeList of decimal or Object[1, 1, 1]The range in blocks within which the entity searches to find a target to drop an item for.
xDecimal0
yDecimal0
zDecimal0
teleport_offsetList of decimal or Object[0, 1, 0]When the entity teleports, offset the teleport position by this many blocks in the X, Y, and Z coordinate.
xDecimal0
yDecimal0
zDecimal0
time_of_day_rangeObject{"max": 1, "min": 0}The valid times of day that this goal can be used. For reference: noon is 0.0, sunset is 0.25, midnight is 0.5, and sunrise is 0.75, and back to noon for 1.0.
minDecimal0
maxDecimal0
loot_tableText""The loot table that contains the possible loot the entity can drop with this goal.
on_drop_attemptObject{"event": "", "filters": {"AND": null, "NOT": null, "OR":…The event to trigger when the entity attempts to drop an item.
eventText""
targetTextself, other, player, target, parent, baby, block, damager, holder, item"self"
filtersObject or List of object{"AND": null, "NOT": null, "OR": null, "all": null, "all_…Filters allow data objects to specify test criteria which allows their use. Filters can be defined by a single object of type (Filter Test), an array of tests, collection groups, or a combination of these objects.
testText—The name of the test to apply.
subjectBoolean or Integer or Decimal or Text—The subject of this filter test.
operatorBoolean or Integer or Decimal or Text—The comparison to apply with 'value'.
domainBoolean or Integer or Decimal or Text—The domain the test should be performed in.
valueBoolean or Integer or Decimal or Text—The value being compared with the test.
entity_typesList of object or Object[]The list of conditions another entity must meet to be a valid target to drop an item for.
filtersObject or List of object{"AND": null, "NOT": null, "OR": null, "all": null, "all_…Conditions that make this entry in the list valid
max_distDecimal16Maximum distance this mob can be away to be a valid choice
max_heightDecimal-1Maximum height this mob can be away to be a valid choice
max_fleeDecimal10Maximum distance this mob can be from the target to stop fleeing
walk_speed_multiplierDecimal1Multiplier for the walking speed. A value of 1.0 means the speed is unchanged
sprint_speed_multiplierDecimal1Multiplier for the sprinting speed. A value of 1.0 means the speed is unchanged
priorityInteger0Priority for this mob type
check_if_outnumberedBooleanfalseIf true, the mob will check if its outnumbered
reevaluate_descriptionBooleanfalseIf true, the mob will stop being targeted if it stops meeting any conditions.
cooldownInteger0The amount of time in seconds that the mob has to wait before selecting a target of the same type again
must_seeBoolean—If true, the mob has to be visible to be a valid choice
must_see_forget_durationInteger3Determines the amount of time in seconds that this mob will look for a target before forgetting about it and looking for a new one when the target isn't visible any more
search_rangeInteger0The distance in blocks the entity will search within to find a valid target position.
search_heightInteger1The height in blocks the entity will search within to find a valid target position.
goal_radiusDecimal0.5Distance in blocks within the mob considers it has reached the goal. This is the "wiggle room" to stop the AI from bouncing back and forth trying to reach a specific spot.
search_countIntegermin 00The number of randomly selected blocks each tick that the mob will check within its search range and height for a valid block to move to. A value of 0 will have the mob check every block within range in one tick.
speed_multiplierDecimalmin 01Movement speed multiplier of the mob when using this goal.
priorityIntegermin 00
control_flagsList of text[]

Example from the game files

This is how vanilla Cat uses it in Minecraft Bedrock 1.26.60.5:

{
  "minecraft:behavior.drop_item_for": {
    "priority": 1,
    "seconds_before_pickup": 0.0,
    "cooldown": 0.25,
    "drop_item_chance": 0.7,
    "offering_distance": 5.0,
    "minimum_teleport_distance": 2.0,
    "max_head_look_at_height": 10.0,
    "target_range": [
      5.0,
      5.0,
      5.0
    ],
    "teleport_offset": [
      0.0,
      1.0,
      0.0
    ],
    "time_of_day_range": {
      "min": 0.74999,
      "max": 0.8
    },
    "search_range": 5,
    "search_height": 2,
    "goal_radius": 1.0,
    "entity_types": [
      {
        "filters": {
          "test": "is_family",
          "subject": "other",
          "value": "player"
        },
        "max_dist": 6
      }
    ],
    "loot_table": "loot_tables/entities/cat_gift.json",
    "on_drop_attempt": {
      "event": "minecraft:cat_gifted_owner",
      "target": "self"
    }
  }
}

Used by 1

Vanilla entities with minecraft:behavior.drop_item_for in their definition:

Related components