0
\$\begingroup\$

I'm making a simple behavior pack for Minecraft's Bedrock Edition for my own experimenting - the aim is to get tamed wolves to play fetch. The behavior pack is valid and loading, as it sort of works, but the part that isn't working is what I've been banging my head against for hours.

As per the tutorial on the official wiki, I've copied entities/wolf.json and entities/player.json from the vanilla behavior pack to my pack and added to them, borrowing cues from the villager's behavior file and referring to the reference for BE's entity components. I've also modified the priorities of the tamed wolf's behaviors so picking up items (i.e. sticks) and sharing them are a higher priority than following the owner or breeding.

wolf.json:

{
    "minecraft:entity": {
        "format_version": "1.2.0",
        "component_groups": {
            ...
            "minecraft:wolf_tame": {
                ...
                "minecraft:behavior.pickup_items": {
                    "priority": 7,
                    "max_dist": 16,
                    "speed_multiplier": 1.5,
                    "track_target": true
                },
                "minecraft:inventory": {
                    "inventory_size": 1,
                    "private": true
                },
                "minecraft:shareables": {
                    "items": [
                        {
                            "item": "minecraft:stick",
                            "want_amount": 1,
                            "surplus_amount": 1
                        }
                    ]
                },
                "minecraft:behavior.share_items": {
                    "priority": 6,
                    "max_dist": 16,
                    "speed_multiplier": 2,
                    "goal_radius": 2.0,
                    "entity_types": [
                        {
                            "filters": {
                                "test": "is_owner",
                                "subject": "other"
                            },
                            "must_see": true
                        }
                    ]
                }
                ...
            }
       }
   }
}

player.json:

{
    "minecraft:entity": {
        "format_version": "1.2.0",
        "components": {
            ...
            "minecraft:shareables": {
                "items": [
                    {
                        "item": "minecraft:stick",
                        "want_amount": 2304,
                        "surplus_amount": 2304
                    }
                ]
            }
        }
    }
}

Currently, a tamed wolf will run over to pick up a dropped stick within 16 blocks of it, but after that it simply resumes following me (its owner) and never drops/shares its sticks. I've messed with the want_amount and surplus_amount of the sticks for both the player and wolf, but with absolutely no results.

\$\endgroup\$
0
\$\begingroup\$

Try the spawn entity portion. From what I understand (I havent tested it yet myself) you can use that to "spawn" shareable items.

Not an ideal solution, but it may be a workable workaround for you.

\$\endgroup\$
0
\$\begingroup\$

Have you tried setting the priority of shareing higher than that of pickup? It might happen where it drops and immediately picks up the stick, due to priorities. It doesn't seem like that is what's happening, but it's worth a shot.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.