Package net.minecraftforge.event.level
Class BlockEvent.FluidPlaceBlockEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.level.BlockEvent
net.minecraftforge.event.level.BlockEvent.FluidPlaceBlockEvent
- Enclosing class:
BlockEvent
Fired when a liquid places a block. Use
setNewState(BlockState)
to change the result of
a cobblestone generator or add variants of obsidian. Alternatively, you could execute
arbitrary code when lava sets blocks on fire, even preventing it.
BlockEvent.getState()
will return the block that was originally going to be placed.
BlockEvent.getPos()
will return the position of the block to be changed.-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.event.level.BlockEvent
BlockEvent.BlockToolModificationEvent, BlockEvent.BreakEvent, BlockEvent.CreateFluidSourceEvent, BlockEvent.CropGrowEvent, BlockEvent.EntityMultiPlaceEvent, BlockEvent.EntityPlaceEvent, BlockEvent.FarmlandTrampleEvent, BlockEvent.FluidPlaceBlockEvent, BlockEvent.NeighborNotifyEvent, BlockEvent.PortalSpawnEvent
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
ConstructorDescriptionFluidPlaceBlockEvent
(LevelAccessor level, BlockPos pos, BlockPos liquidPos, BlockState state) -
Method Summary
Methods inherited from class net.minecraftforge.event.level.BlockEvent
getLevel, getPos, getState
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
Field Details
-
liquidPos
-
newState
-
origState
-
-
Constructor Details
-
FluidPlaceBlockEvent
public FluidPlaceBlockEvent(LevelAccessor level, BlockPos pos, BlockPos liquidPos, BlockState state)
-
-
Method Details
-
getLiquidPos
- Returns:
- The position of the liquid this event originated from. This may be the same as
BlockEvent.getPos()
.
-
getNewState
- Returns:
- The block state that will be placed after this event resolves.
-
setNewState
-
getOriginalState
- Returns:
- The state of the block to be changed before the event was fired.
-