mojira.dev
MCPE-228197

Breaking a lead that is attached to a fence doesn't trigger minecraft:on_unleash

In developing an add-on, I’ve discovered that when breaking a lead that is attached between an entity and a fence post, the minecraft:on_unleash event trigger is not activated.

Here is the relevant code I’ve been using to test this:

[.....]
        "minecraft:leashable": {
          "on_leash": {
            "event": "omb:leash_combo",
            "target": "self"
          },
          "on_unleash": {
            "event": "omb:unleash_combo",
            "target": "self"
          }
        },
[.....]
      "events": {
        "omb:leash_combo": {
          "sequence": [
            {
              "trigger": "minecraft:on_leash"
            },
            {
              "trigger": "omb:on_leash"
            }
          ]
        },
        "omb:unleash_combo": {
          "sequence": [
            {
              "trigger": "minecraft:on_unleash"
            },
            {
              "trigger": "omb:on_unleash"
            }
          ]
        },
        "omb:on_leash": {
          "queue_command": {
            "command": "tag @s add leashed"
            }
          },
        "omb:on_unleash": {
          "queue_command": {
            "command" : "tag @s remove leashed"
          }
        },
[.....]

With this code included in my add-on, the tag “leashed” is applied whenever an entity has a lead attached to it. The tag persists until the player personally removes a lead from the entity.

If the player hitches the entity to a fence and then breaks the lead, the “leashed” tag is not removed. The player is forced to re-attach a lead to the entity and then break it directly.

Attachments

Comments 3

Could you please attach an example addon showcasing the issue?

This issue is being temporarily resolved as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

[media]

Here’s the add-on I've been working on.

To see the issue, summon omb:pet_bat and feed it a gold nugget to tame it, then you'll be able to attach a lead.

If you list the tags, you can see that the “leashed” tag is applied when a lead is attached, but will only be removed when the player physically removes the lead- not when the lead is broken.

It is also possible that I don't know what I am doing. More than possible, actually.

Tim

(Unassigned)

Unconfirmed

Windows

Windows 10 Pro 22H2

1.21.101 Hotfix

Retrieved