FluidPlaceBlockEvent

Fired when a fluid places a block. This can happen on one of two scenarios:

  1. When fluids touch each other, spawning a block (When Lava and Water touch they create Cobblestone).
  2. When Lava spawns fire around it.

You can use this event to change what block is set, so you could replace cobblestone with something else.

The event is not cancelable.

The event does not have a result.

Importing the class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

script.zs
import crafttweaker.api.event.block.FluidPlaceBlockEvent;

Extending BlockEvent

FluidPlaceBlockEvent extends BlockEvent. That means all methods available in BlockEvent are also available in FluidPlaceBlockEvent

Methods

Gets the position of the Fluid that fired this event.

Returns: The position of the Fluid.
Return Type: BlockPos

script.zs
// FluidPlaceBlockEvent.getFluidPos() as BlockPos
myFluidPlaceBlockEvent.getFluidPos();

Gets the new BlockState that will be placed.

Returns: The new BlockState that will be placed.
Return Type: BlockState

script.zs
// FluidPlaceBlockEvent.getNewState() as BlockState
myFluidPlaceBlockEvent.getNewState();

Gets the original BlockState in the world before the event was fired.

Returns: The original BlockState in the world before the event was fired.
Return Type: BlockState

script.zs
// FluidPlaceBlockEvent.getOriginalState() as BlockState
myFluidPlaceBlockEvent.getOriginalState();

Sets the new BlockState that will be placed.

script.zs
// FluidPlaceBlockEvent.setNewState(state as BlockState)
myFluidPlaceBlockEvent.setNewState(<blockstate:minecraft:dirt>);
ParameterTypeDescription
Parameter
state
Type
BlockState
Description
The new BlockState.

Properties

NameTypeHas GetterHas SetterDescription
Name
fluidPos
Type
BlockPos
Has Getter
true
Has Setter
false
Description
Gets the position of the Fluid that fired this event.
Name
newState
Type
BlockState
Has Getter
true
Has Setter
true
Description
Gets the new BlockState that will be placed.
Name
originalState
Type
BlockState
Has Getter
true
Has Setter
false
Description
Gets the original BlockState in the world before the event was fired.