Interface IInteraction
- All Known Subinterfaces:
IFlammableBehavior
,IInteractionBehavior
,IInteractionWithNeighborBlockUpdate
,IInteractionWithNeighborBlockUpdateBehavior
- All Known Implementing Classes:
FlammableBehavior
@ParametersAreNonnullByDefault
public interface IInteraction
Api for creating behavior interface that have interactions between entity, block, fluid, or item
I split this from IInteractionBehavior
just because to separate the abstract interactions and functionality implementation, usually you will neven need this class
Usually you will never need this, just use IInteractionBehavior
- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
interactWithBlock
(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState interactant) Interact with a blockdefault void
interactWithBlockDestroyed
(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState interactant) Interact with a block *when* the fluid destroyed the blockdefault void
interactWithEntity
(net.minecraft.core.BlockPos pos, net.minecraft.world.entity.Entity interactant) Interact with an entitydefault void
interactWithFluid
(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.material.Fluid interactant) Interact with a fluiddefault void
interactWithItem
(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, net.minecraft.world.item.ItemStack interactant) Interact with an item
-
Method Details
-
interactWithEntity
default void interactWithEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.entity.Entity interactant) Interact with an entity
This will default call
when it's ainteractWithItem(LevelAccessor, BlockPos, ItemStack)
ItemEntity
- Parameters:
pos
- The position of the blockinteractant
- The entity that is interacting with the fluid- Since:
- 2.0
-
interactWithBlock
default void interactWithBlock(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState interactant) Interact with a block
This will default call
interactWithFluid(LevelAccessor, BlockPos, Fluid)
when the block has a fluid state- Parameters:
level
- The levelpos
- The position of the blockinteractant
- The block that is interacting with the fluid- Since:
- 2.0
-
interactWithBlockDestroyed
default void interactWithBlockDestroyed(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState interactant) Interact with a block *when* the fluid destroyed the block
This will default redirect to
interactWithBlock(LevelAccessor, BlockPos, BlockState)
- Parameters:
level
- The levelpos
- The position of the blockinteractant
- The block that is interacting with the fluid- Since:
- 2.0
-
interactWithFluid
default void interactWithFluid(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.material.Fluid interactant) Interact with a fluid
- Parameters:
level
- The levelpos
- The position of the blockinteractant
- The fluid that is interacting with the fluid- Since:
- 2.0
-
interactWithItem
default void interactWithItem(net.minecraft.world.level.LevelAccessor level, net.minecraft.core.BlockPos pos, net.minecraft.world.item.ItemStack interactant) Interact with an item
- Parameters:
level
- The levelpos
- The position of the blockinteractant
- The item that is interacting with the fluid- Since:
- 2.0
-