Class TumblestoneBlockEvent.PreGrow
java.lang.Object
net.neoforged.bus.api.Event
com.pixelmonmod.pixelmon.api.events.blocks.TumblestoneBlockEvent
com.pixelmonmod.pixelmon.api.events.blocks.TumblestoneBlockEvent.PreGrow
- All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent
- Enclosing class:
TumblestoneBlockEvent
public static class TumblestoneBlockEvent.PreGrow
extends TumblestoneBlockEvent
implements net.neoforged.bus.api.ICancellableEvent
Fired in the random tick before the tumblestone attempts to increase in age (grow)
Cancelling will prevent it from attempting to grow
-
Nested Class Summary
Nested classes/interfaces inherited from class com.pixelmonmod.pixelmon.api.events.blocks.TumblestoneBlockEvent
TumblestoneBlockEvent.PostBlockBroke, TumblestoneBlockEvent.PostBlockDestroy, TumblestoneBlockEvent.PostCooldownEnd, TumblestoneBlockEvent.PostGrow, TumblestoneBlockEvent.PreBlockBroke, TumblestoneBlockEvent.PreBlockDestroy, TumblestoneBlockEvent.PreCooldownEnd, TumblestoneBlockEvent.PreGrow
-
Constructor Summary
ConstructorsConstructorDescriptionPreGrow
(net.minecraft.world.level.Level level, net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos, float chance) Basic constructor -
Method Summary
Methods inherited from class com.pixelmonmod.pixelmon.api.events.blocks.TumblestoneBlockEvent
getPos, getState, getWorld
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
Constructor Details
-
PreGrow
public PreGrow(net.minecraft.world.level.Level level, net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos, float chance) Basic constructor- Parameters:
state
- The block statepos
- The position of the tumblestonechance
- The chance of growth
-
-
Method Details
-
getChance
public float getChance()The change of the growth happening this random tick- Returns:
- The chance
-
setChance
public void setChance(float chance) Change the chance of the growth happening this tick- Parameters:
chance
- The new change (used as 1/chance)
-