Added events for endermen pickup/placement blocks and methods to get/set the block that an enderman is holding. Thanks Wizjany
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package org.bukkit.event.entity;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
public class EndermanPickupEvent extends EntityEvent implements Cancellable {
|
||||
|
||||
private boolean cancel;
|
||||
private Block block;
|
||||
|
||||
public EndermanPickupEvent(Entity what, Block block) {
|
||||
super(Type.ENDERMAN_PICKUP, what);
|
||||
this.block = block;
|
||||
this.cancel = false;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the block that the enderman is going to pick up.
|
||||
*
|
||||
* @return block the enderman is about to pick up
|
||||
*/
|
||||
public Block getBlock() {
|
||||
return block;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user