Interface FabricBlockParticleOption


public interface FabricBlockParticleOption
Note: This interface is automatically implemented on BlockParticleOption via Mixin and interface injection.
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.core.particles.BlockParticleOption
    create(net.minecraft.core.particles.ParticleType<net.minecraft.core.particles.BlockParticleOption> type, net.minecraft.world.level.block.state.BlockState blockState, @Nullable net.minecraft.core.BlockPos blockPos)
    Alternative for BlockParticleOption(ParticleType, BlockState) that also accepts a BlockPos.
    default @Nullable net.minecraft.core.BlockPos
     
  • Method Details

    • create

      static net.minecraft.core.particles.BlockParticleOption create(net.minecraft.core.particles.ParticleType<net.minecraft.core.particles.BlockParticleOption> type, net.minecraft.world.level.block.state.BlockState blockState, @Nullable net.minecraft.core.BlockPos blockPos)
      Alternative for BlockParticleOption(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 BlockGetter.getBlockState(BlockPos). This ensures that any particles created from this option 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 option
    • getBlockPos

      default @Nullable net.minecraft.core.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