SHARE
TWEET

Untitled

a guest Feb 26th, 2020 346 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         var tinBlock = VanillaFactory.createItem("tin_block");
  2.         tinBlock.creativeTab = metalCrafts;
  3.         tinBlock.onItemUse = function(player, world, pos, hand, facing, blockHit) {
  4.             var blockPos = pos;
  5.             var blockPosUp = pos.getOffset(facing, 1);
  6.             if (world.getBlockState(blockPos) == <block:minecraft:cauldron:3>) {
  7.                 world.setBlockState(<block:minecraft:cauldron:2>, blockPos);
  8.                 Commands.call("playsound minecraft:block.fire.extinguish block @p", player, world, false, true);
  9.                 Commands.call("give @p contenttweaker:tin_block 1", player, world, false, true);
  10.                 player.getHeldItem(hand).shrink(1);
  11.                 return ActionResult.success();
  12.             }
  13.                 else {
  14.                        world.setBlockState(<block:minecraft:stone>, blockPosUp);
  15.                        Commands.call("playsound minecraft:block.metal.place block @p", player, world, false, true);
  16.                        player.getHeldItem(hand).shrink(1);
  17.                      }
  18.             if (world.getBlockState(blockPos) == <block:minecraft:cauldron:2>) {
  19.                 world.setBlockState(<block:minecraft:cauldron:1>, blockPos);
  20.                 Commands.call("playsound minecraft:block.fire.extinguish block @p", player, world, false, true);
  21.                 Commands.call("give @p contenttweaker:tin_block 1", player, world, false, true);
  22.                 player.getHeldItem(hand).shrink(1);
  23.                 return ActionResult.success();
  24.             }
  25.             if (world.getBlockState(blockPos) == <block:minecraft:cauldron:1>) {
  26.                 world.setBlockState(<block:minecraft:cauldron>, blockPos);
  27.                 Commands.call("playsound minecraft:block.fire.extinguish block @p", player, world, false, true);
  28.                 Commands.call("give @p contenttweaker:tin_block 1", player, world, false, true);
  29.                 player.getHeldItem(hand).shrink(1);
  30.                 return ActionResult.success();
  31.             }
  32.             return ActionResult.pass();
  33.         };
  34.         tinBlock.register();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top