Jump to content

Lxs_

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Lxs_

  1. how could i tp the player to an unloaded dimension right after the clearInventory @Override public InteractionResultHolder<ItemStack> use(Level level, Player player, InteractionHand usedHand) { player.playSound(Sounds.CORRUPT_CRYSTAL_USE.get(), 1f, 1f); player.getCooldowns().addCooldown(this, 100); player.addEffect(new MobEffectInstance(MobEffects.BLINDNESS, 150, 355)); player.getInventory().clearContent(); return super.use(level, player, usedHand); }
  2. So, I’m making a 1.16.5 mod and I want to detect when the player steps off a custom block that I made. How could I do that? Here is my code. package com.lxs.randomshit.block.custom; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class WeakBlock extends Block { public WeakBlock(Properties properties) { super(properties); } @Override public void onEntityWalk(World world, BlockPos blockPos, Entity entity) { world.destroyBlock(blockPos, true, entity); super.onEntityWalk(world, blockPos, entity); } }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.