Interface FabricBlockStateParticleEffect


public interface FabricBlockStateParticleEffect
Note: This interface is automatically implemented on BlockStateParticleEffect via Mixin and interface injection.
  • Method Details

    • create

      static BlockStateParticleEffect create(ParticleType<BlockStateParticleEffect> type, BlockState blockState, @Nullable @Nullable BlockPos blockPos)
      Alternative for BlockStateParticleEffect(ParticleType, BlockState) that also accepts a BlockPos. This method should be used instead of the vanilla constructor when the block state is retrieved using a block pos, most commonly through BlockView.getBlockState(BlockPos). This ensures that any particles created from this effect use an accurate pos for any client-side logic.

      If an instance with a non-null block pos needs to be synced to the client, the block pos will only be synced if it is known that the client supports decoding it (has this Fabric API module installed); otherwise, the effect will be sent as a vanilla effect and the client will produce a null block pos.

      Parameters:
      type - the particle type
      blockState - the block state
      blockPos - the block pos from which the block state was retrieved
      Returns:
      the particle effect
    • getBlockPos

      @Nullable default @Nullable BlockPos getBlockPos()
      Returns:
      the block pos from which the block state was retrieved, or null if not applicable or this instance was synced from a remote server that does not have this Fabric API module installed