Jump to content

ilyass555

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by ilyass555

  1. ohh yeah figured it out @Override public ActionResultType onItemUse(ItemUseContext context) { World world = context.getWorld(); BlockPos pos = context.getPos(); PlayerEntity playerIn = context.getPlayer(); ItemStack item = context.getItem(); Hand handIn = context.getHand(); if (!world.isRemote && world.getBlockState(pos).getBlock() == Blocks.MOSSY_COBBLESTONE) { (( ServerWorld)world).setBlockState(pos, Blocks.COBBLESTONE.getDefaultState()); item.damageItem(1, playerIn, (entity) -> {entity.sendBreakAnimation(handIn);;}); playerIn.inventory.addItemStackToInventory(new ItemStack(ItemInit.moss)); } return super.onItemUse(context); }
  2. so i want to make it so when i right click mossycobble(vanilla block) by my custom item it changes to cobble and drops another custom item, i know i have to use onItemUse but i am new to java. Thnx in advance
×
×
  • Create New...

Important Information

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