Jump to content

Damckell

Members
  • Posts

    2
  • Joined

  • Last visited

Damckell's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Alright, I've figured out how to summon frosted ice at the surface of liquids, and to change other liquid sources like lava into obsidian. Thank you!
  2. I'm currently trying to create an item that when you right-click a water source, it replaces the water source with an ice block. I can't quite figure out how to detect if the block I'm clicking on is water, or how to change it to ice. So far this is all the code I have: public ActionResultType onItemRightClick(ItemUseContext context) { World world = context.getWorld(); PlayerEntity player = context.getPlayer(); Hand handIn = context.getHand(); BlockPos pos = context.getPos(); ItemStack itemstack = context.getItem(); if (world.getBlockState(pos) == Blocks.WATER.getDefaultState()) { world.setBlockState(pos, Blocks.ICE.getDefaultState().getBlockState()); } if (!player.abilities.isCreativeMode) { itemstack.damageItem(1, player, (p_219998_1_) -> { p_219998_1_.sendBreakAnimation(handIn); }); } return ActionResultType.SUCCESS; } Any help would be appreciated!
×
×
  • Create New...

Important Information

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