public abstract class PlayerBucketEvent extends PlayerEvent implements Cancellable
Event.Result
player
构造器和说明 |
---|
PlayerBucketEvent(Player who,
Block blockClicked,
BlockFace blockFace,
Material bucket,
ItemStack itemInHand) |
限定符和类型 | 方法和说明 |
---|---|
Block |
getBlockClicked()
玩家正在对着哪个方块使用桶,返回那个方块.
|
BlockFace |
getBlockFace()
获取方块被点击的面.
|
Material |
getBucket()
返回玩家手里的桶的类型.
|
ItemStack |
getItemStack()
得到使用桶之后会得到的物品堆叠.
|
boolean |
isCancelled()
获取这个事件是否被取消.一个被取消的事件不会在服务器里被执行,但是仍然会传递事件到其他插件。
|
void |
setCancelled(boolean cancel)
取消这个事件.
|
void |
setItemStack(ItemStack itemStack)
设置使用桶之后得到的物品.
|
getPlayer
getEventName, getHandlers, isAsynchronous
public Material getBucket()
假设玩家使用空桶装水,则会返回空桶的类型
原文: Returns the bucket used in this event
public ItemStack getItemStack()
假设玩家使用空桶装水,则会返回一个装满水的桶
原文: Get the resulting item in hand after the bucket event
public void setItemStack(ItemStack itemStack)
假设玩家使用空桶装水,原来玩家会一个装满水的桶,你可以使用这个方法改变这个结果. 例如改成岩浆桶.
原文: Set the item in hand after the event
itemStack
- 新的事件结果public Block getBlockClicked()
原文: Return the block clicked
public BlockFace getBlockFace()
每个方块有6个面,玩家究竟是点击的哪个呢.
原文: Get the face on the clicked block
public boolean isCancelled()
Cancellable
原文:Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins
isCancelled
在接口中 Cancellable
public void setCancelled(boolean cancel)
Cancellable
原文:Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.
setCancelled
在接口中 Cancellable
cancel
- 如果你想取消这个事件,则为true