Interface FabricBlockParticleOption
public interface FabricBlockParticleOption
Note: This interface is automatically implemented on
BlockParticleOption via Mixin and interface injection.-
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.core.particles.BlockParticleOptioncreate(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 forBlockParticleOption(ParticleType, BlockState)that also accepts aBlockPos.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 forBlockParticleOption(ParticleType, BlockState)that also accepts aBlockPos. This method should be used instead of the vanilla constructor when the block state is retrieved using a block pos, most commonly throughBlockGetter.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 typeblockState- the block stateblockPos- 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
nullif not applicable or this instance was synced from a remote server that does not have this Fabric API module installed
-