blob: 07663db369e600b812e33939321d5ddffd3d0939 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
package org.bukkit.event.player;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
/**
* Represents an event that is called when a player right clicks an entity.
*/
public class PlayerInteractEntityEvent extends PlayerEvent implements Cancellable {
protected Entity clickedEntity;
boolean cancelled = false;
public PlayerInteractEntityEvent(Player who, Entity clickedEntity) {
super(Type.PLAYER_INTERACT_ENTITY, who);
this.clickedEntity = clickedEntity;
}
public boolean isCancelled() {
return cancelled;
}
public void setCancelled(boolean cancel) {
this.cancelled = cancel;
}
/**
* Gets the entity that was rightclicked by the player.
*
* @return entity right clicked by player
*/
public Entity getRightClicked() {
return this.clickedEntity;
}
}
|