public class PlayerEggThrowEvent extends PlayerEvent
Event.Result
player
Constructor and Description |
---|
PlayerEggThrowEvent(@NotNull Player player,
@NotNull Egg egg,
boolean hatching,
byte numHatches,
@NotNull EntityType hatchingType) |
Modifier and Type | Method and Description |
---|---|
@NotNull Egg |
getEgg()
Gets the egg involved in this event.
|
static @NotNull HandlerList |
getHandlerList() |
@NotNull HandlerList |
getHandlers() |
@NotNull EntityType |
getHatchingType()
Get the type of the mob being hatched (EntityType.CHICKEN by default)
|
byte |
getNumHatches()
Get the number of mob hatches from the egg.
|
boolean |
isHatching()
Gets whether the egg is hatching or not.
|
void |
setHatching(boolean hatching)
Sets whether the egg will hatch or not.
|
void |
setHatchingType(@NotNull EntityType hatchType)
Change the type of mob being hatched by the egg
|
void |
setNumHatches(byte numHatches)
Change the number of mobs coming out of the hatched egg
|
getPlayer
callEvent, getEventName, isAsynchronous
@NotNull public @NotNull Egg getEgg()
public boolean isHatching()
public void setHatching(boolean hatching)
hatching
- true if you want the egg to hatch, false if you want it
not to@NotNull public @NotNull EntityType getHatchingType()
public void setHatchingType(@NotNull @NotNull EntityType hatchType)
hatchType
- The type of the mob being hatched by the eggpublic byte getNumHatches()
public void setNumHatches(byte numHatches)
The boolean hatching will override this number. Ie. If hatching = false, this number will not matter
numHatches
- The number of mobs coming out of the egg@NotNull public @NotNull HandlerList getHandlers()
getHandlers
in class Event
@NotNull public static @NotNull HandlerList getHandlerList()
Copyright © 2021. All rights reserved.