How can I tell if I'm dismounting a chicken?

Discussion in 'CommandHelper' started by malon, Jul 8, 2017.

  1. malon

    malon Member

    I'm looking to hook into the event triggered when dismounting a chicken.
    First I set a person riding a chicken with set_entity_rider()

    Then I give them the following bind

    The broadcast never triggers

    Code (Text):
    bind(vehicle_leave, null, null, @event) {
        if(@event['player'] == @player){
            broadcast(@event)
            entity_remove(@event['vehicle'])
            unbind()
            }
        }
    }
    Last edited: Jul 8, 2017
  2. PseudoKnight

    PseudoKnight Well-Known Member

    vehicle_leave only triggers when you leave an actual vehicle entity. In Spigot they later added a different event, "EntityDismountEvent", to provide a solution for other entities. This is only a part of the Spigot API, so entity_dismount is an event in CHSpigot.

    https://letsbuild.net/jenkins/job/CHSpigot/
  3. malon

    malon Member

    I love you man! always with the answer! Thank you!
  4. PseudoKnight

    PseudoKnight Well-Known Member