Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.sniklz.firstmod.block;
- import net.minecraft.core.BlockPos;
- import net.minecraft.network.chat.TextComponent;
- import net.minecraft.world.entity.LivingEntity;
- import net.minecraft.world.item.ItemStack;
- import net.minecraft.world.level.Level;
- import net.minecraft.world.level.block.Block;
- import net.minecraft.world.level.block.state.BlockState;
- import org.jetbrains.annotations.Nullable;
- public class PlacedBlock extends Block {
- public PlacedBlock(Properties properties) {
- super(properties);
- }
- @Override
- public void setPlacedBy(Level pLevel, BlockPos pPos, BlockState pState, @Nullable LivingEntity pPlacer, ItemStack pStack) {
- super.setPlacedBy(pLevel, pPos, pState, pPlacer, pStack);
- if(pLevel.isWaterAt(pPos.below())) {
- pPlacer.sendMessage(new TextComponent("Under block is water" ), pPlacer.getUUID());
- } else {
- pPlacer.sendMessage(new TextComponent("Under block no water(" ), pPlacer.getUUID());
- }
- }
- }
Add Comment
Please, Sign In to add comment