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

minecraft:shareables

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

Overview

minecraft:shareables is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Lists items the mob likes to pick up and share with others of its kind, like villagers passing food to each other.

Fields

FieldTypeDefaultDescription
all_itemsBoolean"false"If true, the mob also wants every item not on the list, with the lowest priority.
all_items_max_amountInteger"-1"Most of those other items the mob will carry.
all_items_surplus_amountInteger"-1"How many of those items count as extra that it is happy to give away.
all_items_want_amountInteger"-1"How many of those items the mob wants to hold.
itemsListnoneItems or item tags the mob cares about, checked from top to bottom so the first match wins.
singular_pickupBoolean"false"If true, the mob only picks up one of an item it already has.

Example

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

BP/entities/<name>.json
{
  "minecraft:shareables": {
    "all_items": "false",
    "all_items_max_amount": "-1",
    "all_items_surplus_amount": "-1",
    "all_items_want_amount": "-1",
    "items": {},
    "singular_pickup": "false"
  }
}

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