Package net.minecraftforge.event.world
Class SaplingGrowTreeEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.world.WorldEvent
net.minecraftforge.event.world.SaplingGrowTreeEvent
SaplingGrowTreeEvent is fired when a sapling grows into a tree.
This event is fired during sapling growth in
This event is not
This event has a result.
This result determines if the sapling is allowed to grow.
This event is fired on the
This event is fired during sapling growth in
SaplingBlock.advanceTree(ServerLevel, BlockPos, BlockState, Random)
.pos
contains the coordinates of the growing sapling. rand
contains an instance of Random for use. This event is not
Cancelable
.This event has a result.
Event.HasResult
This result determines if the sapling is allowed to grow.
This event is fired on the
MinecraftForge.EVENT_BUS
.-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.event.world.WorldEvent
WorldEvent.CreateSpawnPosition, WorldEvent.Load, WorldEvent.PotentialSpawns, WorldEvent.Save, WorldEvent.Unload
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSaplingGrowTreeEvent
(LevelAccessor world, Random rand, BlockPos pos) Deprecated, for removal: This API element is subject to removal in a future version.SaplingGrowTreeEvent
(LevelAccessor world, Random rand, BlockPos pos, Holder<? extends ConfiguredFeature<?, ?>> feature) -
Method Summary
Modifier and TypeMethodDescriptionHolder<? extends ConfiguredFeature<?,
?>> Returns the holder of the feature which will be placed.getPos()
getRand()
void
setFeature
(Holder<? extends ConfiguredFeature<?, ?>> feature) Methods inherited from class net.minecraftforge.event.world.WorldEvent
getWorld
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getParentListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setup
-
Field Details
-
pos
-
rand
-
feature
-
-
Constructor Details
-
SaplingGrowTreeEvent
@Deprecated(forRemoval=true, since="1.18.2") public SaplingGrowTreeEvent(LevelAccessor world, Random rand, BlockPos pos) Deprecated, for removal: This API element is subject to removal in a future version. -
SaplingGrowTreeEvent
public SaplingGrowTreeEvent(LevelAccessor world, Random rand, BlockPos pos, Holder<? extends ConfiguredFeature<?, ?>> feature)
-
-
Method Details
-
getPos
-
getRand
-
getFeature
Returns the holder of the feature which will be placed.- Returns:
- the holder of the feature which will be placed
-
setFeature
-