Guest User

Magic Mirror Use

a guest
Nov 1st, 2022
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. @Override
  2.     public TypedActionResult<ItemStack> use(World world, PlayerEntity user, Hand hand) {
  3.         if(!world.isClient() && hand == Hand.MAIN_HAND){
  4.             ServerWorld overworld = world.getServer().getWorld(World.OVERWORLD);
  5.             user.moveToWorld(overworld);
  6.             world.playSound(null, user.getBlockPos(), ModSounds.MAGIC_MIRROR_USE,
  7.                     SoundCategory.PLAYERS, 0.25f, 1f);
  8.             user.getItemCooldownManager().set(this, 100);
  9.         }
  10.  
  11.         return super.use(world, user, hand);
  12.     }
Advertisement
Add Comment
Please, Sign In to add comment