MyceliumBlock .java

net.minecraft.world.level.block.MyceliumBlock (class, 24 lines): members: animateTick. imports: BlockItemIds, ParticleTypes, BlockBehaviour.

net.minecraft.world.level.blockclass24 linescommonextends SpreadingSnowyBlock916 B

API Surface (1)

void animateTick(final BlockState state, final Level level, final BlockPos pos, final RandomSource random)

Full Source

MyceliumBlock.java24 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.level.block;
2
3
import net.minecraft.core.BlockPos;
4
import net.minecraft.core.particles.ParticleTypes;
5
import net.minecraft.references.BlockItemIds;
6
import net.minecraft.util.RandomSource;
7
import net.minecraft.world.level.Level;
8
import net.minecraft.world.level.block.state.BlockBehaviour;
9
import net.minecraft.world.level.block.state.BlockState;
10
11
public class MyceliumBlock extends SpreadingSnowyBlock {
12
	public MyceliumBlock(final BlockBehaviour.Properties properties) {
13
		super(properties, BlockItemIds.DIRT.block());
14
	}
15
16
	@Override
17
	public void animateTick(final BlockState state, final Level level, final BlockPos pos, final RandomSource random) {
18
		super.animateTick(state, level, pos, random);
19
		if (random.nextInt(10) == 0) {
20
			level.addParticle(ParticleTypes.MYCELIUM, pos.getX() + random.nextDouble(), pos.getY() + 1.1, pos.getZ() + random.nextDouble(), 0.0, 0.0, 0.0);
21
		}
22
	}
23
}
24

Decompiled Minecraft 26.3 source of MyceliumBlock (net/minecraft/world/level/block/MyceliumBlock.java) with Mojang official mappings, stored verbatim on the site.