[SPIGOT-596] EntityDismountEvent Created: 20/Feb/15  Updated: 26/Oct/15  Resolved: 26/Oct/15

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Daniel Assignee: md_5
Resolution: Fixed Votes: 2
Labels: None

Issue Links:
Cloners
is cloned by SPIGOT-773 EntityDismountEvent Closed
Duplicate
is duplicated by SPIGOT-966 EntityDismountEvent does not fire Closed

 Description   

The EntityDismountEvent doesn't trigger anymore i have used the spigot version i downloaded on the 2015-02-03 (git-Spigot-"c2202d8") and it worked halfe because it trigered when i got off an Bat,Cow... but it didn't trigger when a bat got off me.
But in the new version i downloaded 2015-02-20 (git-Spigot-ed3e3af-ee8d0fa) the event doesn't trigger when i get off a Bat,Cow,Villager



 Comments   
Comment by Z750 [ 25/Oct/15 ]

Fixed and PR submitted.
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/spigot/pull-requests/49/overview

Comment by Kege Kiss [ 31/Mar/15 ]

Still not fixed in the latest version.

Comment by Kege Kiss [ 15/Mar/15 ]

Still not fixed as of today with latest version (1.8.3).

Comment by Daniel [ 28/Feb/15 ]
Command.java
Player p = (Player) sender;
Entity mob = loc.getWorld().spawnEntity(loc, EntityType.BAT);
mob.setPassenger(p);

something like that in an command or if you want the entity on your head

Command.java
p.setPassenger(mob);
Comment by md_5 [ 28/Feb/15 ]

How am I supposed to mount an entity?

Comment by Kege Kiss [ 28/Feb/15 ]

Make a main class that register events of itself and add this function :

MainClass.java
@EventHandler
public void onEntityDismount(EntityDismountEvent event) {
    System.out.println("EntityDismountEvent is called correctly");
    System.out.println("Is EntityDismountEvent cancelled : " + event.isCancelled());
}

You will see that none of the messages will print, because the event is not called.

Comment by md_5 [ 27/Feb/15 ]

Please provide testing materials.

Comment by Kege Kiss [ 27/Feb/15 ]

This issue is still not solved.

Comment by Daniel [ 27/Feb/15 ]

I have now version git-Spigot-6ee12F633d5de3 and it isn't working

Comment by md_5 [ 27/Feb/15 ]

Update your spigot, git-Spigot-ed3e3af-ee8d0fa isn't even a version we have released.

Comment by Kege Kiss [ 22/Feb/15 ]

Confirmed. The problem is in the net.minecraft.server.v1_8_R1.Entity.class, at the mount(Entity) method :

Entity.java
       else {
            if (this.bukkitEntity instanceof LivingEntity && entity.getBukkitEntity() instanceof Vehicle && entity.world.isChunkLoaded((int)entity.locX >> 4, (int)entity.locZ >> 4, true)) {
                VehicleExitEvent exitEvent = null;
                if (this.vehicle != null && this.vehicle.getBukkitEntity() instanceof Vehicle) {
                    exitEvent = new VehicleExitEvent((Vehicle)this.vehicle.getBukkitEntity(), (LivingEntity)this.bukkitEntity);
                    pluginManager.callEvent(exitEvent);
                    if (exitEvent.isCancelled() || this.vehicle != originalVehicle || (this.vehicle != null && this.vehicle.passenger != originalPassenger)) {
                        return;
                    }
                }
====> The EntityDismountEvent is not called through the PluginManager here.
                final VehicleEnterEvent event2 = new VehicleEnterEvent((Vehicle)entity.getBukkitEntity(), this.bukkitEntity);
                pluginManager.callEvent(event2);
                if (event2.isCancelled() || this.vehicle != originalVehicle || (this.vehicle != null && this.vehicle.passenger != originalPassenger)) {
                    if (exitEvent != null && this.vehicle == originalVehicle && this.vehicle != null && this.vehicle.passenger == originalPassenger) {
                        this.setPositionRotation(this.vehicle.locX, this.vehicle.getBoundingBox().b + this.vehicle.length, this.vehicle.locZ, this.yaw, this.pitch);
                        this.vehicle.passenger = null;
                        this.vehicle = null;
                    }
                    return;
                }
            }
Generated at Mon Apr 21 21:46:24 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.