Package net.minecraftforge.event.level
Class SaplingGrowTreeEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.level.LevelEvent
net.minecraftforge.event.level.SaplingGrowTreeEvent
This event is fired whenever a sapling, fungus, mushroom or azalea grows into a tree.
 
This event is not cancellable but does have a result. ALLOW and DEFAULT will allow the sapling to grow using the features set on the event. DENY will prevent the sapling from growing.
This event is fired on the main Forge event bus only on the logical server.
- 
Nested Class SummaryNested classes/interfaces inherited from class net.minecraftforge.event.level.LevelEventLevelEvent.CreateSpawnPosition, LevelEvent.Load, LevelEvent.PotentialSpawns, LevelEvent.Save, LevelEvent.UnloadNested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Eventnet.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate @Nullable Holder<ConfiguredFeature<?,?>> private final BlockPosprivate final RandomSource
- 
Constructor SummaryConstructorsConstructorDescriptionSaplingGrowTreeEvent(LevelAccessor level, RandomSource randomSource, BlockPos pos, @Nullable Holder<ConfiguredFeature<?, ?>> feature) 
- 
Method SummaryModifier and TypeMethodDescription@Nullable Holder<ConfiguredFeature<?,?>> Returns the holder of the feature which will be placed, possibly null.getPos()Returns the coordinates of the sapling attempting to grow.Returns the random source which initiated the sapling growth.voidsetFeature(@Nullable Holder<ConfiguredFeature<?, ?>> feature) voidsetFeature(ResourceKey<ConfiguredFeature<?, ?>> featureKey) Methods inherited from class net.minecraftforge.event.level.LevelEventgetLevelMethods inherited from class net.minecraftforge.eventbus.api.EventgetListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
- 
Field Details- 
randomSource
- 
pos
- 
feature
 
- 
- 
Constructor Details- 
SaplingGrowTreeEventpublic SaplingGrowTreeEvent(LevelAccessor level, RandomSource randomSource, BlockPos pos, @Nullable @Nullable Holder<ConfiguredFeature<?, ?>> feature) 
 
- 
- 
Method Details- 
getRandomSourceReturns the random source which initiated the sapling growth.- Returns:
- the random source which initiated the sapling growth
 
- 
getPosReturns the coordinates of the sapling attempting to grow.- Returns:
- the coordinates of the sapling attempting to grow
 
- 
getFeatureReturns the holder of the feature which will be placed, possibly null.- Returns:
- the holder of the feature which will be placed, possibly null
 
- 
setFeature- Parameters:
- feature- a Holder referencing a tree feature to be placed instead of the current feature.
 
- 
setFeature- Parameters:
- featureKey- a ResourceKey referencing a tree feature to be placed instead of the current feature.
 
 
-