package net.minecraft.world.level.block; import com.mojang.serialization.MapCodec; import net.minecraft.core.BlockPos; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; public class MagmaBlock extends Block { public static final MapCodec CODEC = simpleCodec(MagmaBlock::new); @Override public MapCodec codec() { return CODEC; } public MagmaBlock(final BlockBehaviour.Properties properties) { super(properties); } @Override public void stepOn(final Level level, final BlockPos pos, final BlockState onState, final Entity entity) { if (!entity.isSteppingCarefully() && entity instanceof LivingEntity) { entity.hurt(level.damageSources().hotFloor(), 1.0F); } super.stepOn(level, pos, onState, entity); } }