类 PlayerEggThrowEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
org.bukkit.event.player.PlayerEggThrowEvent
玩家抛出鸡蛋时触发本事件,鸡蛋可能孵化.
-
嵌套类概要
从类继承的嵌套类/接口 org.bukkit.event.Event
Event.Result
-
字段概要
从类继承的字段 org.bukkit.event.player.PlayerEvent
player
-
构造器概要
构造器说明PlayerEggThrowEvent
(@NotNull Player player, @NotNull Egg egg, boolean hatching, byte numHatches, @NotNull EntityType hatchingType) -
方法概要
修饰符和类型方法说明getEgg()
获取事件中的鸡蛋.static @NotNull HandlerList
获取将被孵化的生物类型 (默认为EntityType.CHICKEN ).byte
检测将被孵化生物的数量。boolean
检测鸡蛋是否将被孵化。void
setHatching
(boolean hatching) 设置鸡蛋是否将被孵化.void
setHatchingType
(@NotNull EntityType hatchType) 修改将被孵化生物的类型.void
setNumHatches
(byte numHatches) 改变将被孵化生物的数量.从类继承的方法 org.bukkit.event.player.PlayerEvent
getPlayer
从类继承的方法 org.bukkit.event.Event
getEventName, isAsynchronous
-
构造器详细资料
-
PlayerEggThrowEvent
-
-
方法详细资料
-
getEgg
获取事件中的鸡蛋.原文:Gets the egg involved in this event.
- 返回:
- 事件中的鸡蛋
-
isHatching
public boolean isHatching()检测鸡蛋是否将被孵化。服务器可能设置无互动.原文:Gets whether the egg is hatching or not. Will be what the server would've done without interaction.
- 返回:
- 鸡蛋是否将被孵化
-
setHatching
public void setHatching(boolean hatching) 设置鸡蛋是否将被孵化.原文:Sets whether the egg will hatch or not.
- 参数:
hatching
- 你是否希望鸡蛋孵化
-
getHatchingType
获取将被孵化的生物类型 (默认为EntityType.CHICKEN ).原文:Get the type of the mob being hatched (EntityType.CHICKEN by default)
- 返回:
- 将被孵化的生物类型
-
setHatchingType
修改将被孵化生物的类型.原文:Change the type of mob being hatched by the egg
- 参数:
hatchType
- 将被孵化生物的类型
-
getNumHatches
public byte getNumHatches()检测将被孵化生物的数量。默认由服务器进行设置.- 7/8 几率不生成
- 31/256 ~= 1/8 的几率生成 1 只
- 1/256 的几率生成 4 只
原文:Get the number of mob hatches from the egg. By default the number will be the number the server would've done
- 7/8 chance of being 0
- 31/256 ~= 1/8 chance to be 1
- 1/256 chance to be 4
- 返回:
- 将被孵化生物的数量
-
setNumHatches
public void setNumHatches(byte numHatches) 改变将被孵化生物的数量.hatching
的值将覆盖该数值的作用。 如果hatching
被设为false, 则本数值不会生效。原文:Change the number of mobs coming out of the hatched egg
The boolean hatching will override this number. Ie. If hatching = false, this number will not matter
- 参数:
numHatches
- 将被孵化生物的数量
-
getHandlers
- 指定者:
getHandlers
在类中Event
-
getHandlerList
-