minecraft:shareables
Defines a list of items the mob wants to share. Each item must have the following parameters:
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
singular_pickup | Boolean | false | Boolean value that controls if the mob is able to pick up more of the same item if it is already holding that item |
all_items | Boolean | false | A bucket for all other items in the game. Note this category is always least priority items. |
all_items_want_amount | Integer | -1 | Number of this item this entity wants to share. |
all_items_surplus_amount | Integer | -1 | Number of this item considered extra that the entity wants to share. |
all_items_max_amount | Integer | -1 | Maximum number of this item the mob will hold. |
items | List of object | [] | List of items or item tags that the entity wants to share. Items in-game will match to this list from top to bottom, meaning that the first occurance of a match, be it name or tag, will shadow those coming after. |
item | Text or Object | — | The name of the item. Aux value can be specified, for instance 'minecraft:skull:1'. Alternatively, a tag can be specified to match all items with that tag. |
want_amount | Integer | -1 | Number of this item this entity wants to share. |
surplus_amount | Integer | -1 | Number of this item considered extra that the entity wants to share. |
max_amount | Integer | -1 | Maximum number of this item the mob will hold. |
pickup_limit | Integer | -1 | Maximum number items the mob will pick up during a single goal tick. |
craft_into | Text | "" | Defines the item this entity wants to craft with the item defined by "item". Should be an item name. |
priority | Integer | 0 | Prioritizes which items the entity prefers. 0 is the highest priority. |
admire | Boolean | false | Mob will admire the item after picking up by looking at it. For this to happen the mob needs to have an Admire component and an Admire goal. |
barter | Boolean | false | Mob will barter for the item after picking it up. For this to work the mob needs to have a Barter component and a Barter goal. |
stored_in_inventory | Boolean | false | Determines whether the mob will try to put the item in its inventory if it has the inventory component and if it can't be equipped. |
consume_item | Boolean | false | Determines whether the mob will consume the item or not. |
pickup_only | Boolean | false | Determines whether the mob can only pickup the item and not drop it. |
Example from the game files
This is how vanilla Bogged uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:shareables": {
"items": [
{
"item": "minecraft:netherite_sword",
"priority": 0,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:diamond_sword",
"priority": 1,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:iron_sword",
"priority": 2,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:golden_sword",
"priority": 3,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:copper_sword",
"priority": 4,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:stone_sword",
"priority": 5,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:wooden_sword",
"priority": 6,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:bow",
"priority": 6,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:netherite_helmet",
"priority": 0,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:diamond_helmet",
"priority": 1,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:iron_helmet",
"priority": 2,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:chainmail_helmet",
"priority": 3,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:golden_helmet",
"priority": 4,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:copper_helmet",
"priority": 5,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:leather_helmet",
"priority": 6,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:turtle_helmet",
"priority": 7,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:skull:0",
"priority": 8,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:skull:1",
"priority": 8,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:carved_pumpkin",
"priority": 8,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:netherite_chestplate",
"priority": 0,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:diamond_chestplate",
"priority": 1,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:iron_chestplate",
"priority": 2,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:chainmail_chestplate",
"priority": 3,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:golden_chestplate",
"priority": 4,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:copper_chestplate",
"priority": 5,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:leather_chestplate",
"priority": 6,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:netherite_leggings",
"priority": 0,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:diamond_leggings",
"priority": 1,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:iron_leggings",
"priority": 2,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:chainmail_leggings",
"priority": 3,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:golden_leggings",
"priority": 4,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:copper_leggings",
"priority": 5,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:leather_leggings",
"priority": 6,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:netherite_boots",
"priority": 0,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:diamond_boots",
"priority": 1,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:iron_boots",
"priority": 2,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:chainmail_boots",
"priority": 3,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:golden_boots",
"priority": 4,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:copper_boots",
"priority": 5,
"surplus_amount": 1,
"want_amount": 1
},
{
"item": "minecraft:leather_boots",
"priority": 6,
"surplus_amount": 1,
"want_amount": 1
}
],
"singular_pickup": true
}
}Used by 19
Vanilla entities with minecraft:shareables in their definition: