Class AlterGroundEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.level.AlterGroundEvent

public class AlterGroundEvent extends net.minecraftforge.eventbus.api.Event
This event is fired when AlterGroundDecorator.placeBlockAt(TreeDecorator.Context, BlockPos) attempts to alter a ground block when generating a feature. An example of this would be large spruce trees converting grass blocks into podzol.

This event is not cancellable.

This event is fired on the main Forge event bus only on the logical server.

  • Field Details

  • Constructor Details

  • Method Details

    • getLevel

      public LevelSimulatedReader getLevel()
    • getRandom

      public RandomSource getRandom()
    • getPos

      public BlockPos getPos()
      Returns the position of the block that will be altered.
      Returns:
      the position of the block that will be altered
    • getOriginalAlteredState

      public BlockState getOriginalAlteredState()
      Returns the original block state that would be placed by the ground decorator.
      Returns:
      the original block state that would be placed by the ground decorator
    • getNewAlteredState

      public BlockState getNewAlteredState()
      Returns the new block state to be placed by the ground decorator.
      Returns:
      the new block state to be placed by the ground decorator
    • setNewAlteredState

      public void setNewAlteredState(BlockState newAltered)
      Parameters:
      newAltered - the new block state to be placed by the ground decorator