Here is my code it is not possible to install the block on the right mouse button
public class SaltyIngot extends Item {
public SaltyIngot() {
super(new Properties().group(ModItemGroups.MOD_MATERIALS_TAB));
}
@Override
public ActionResult<ItemStack> onItemRightClick(World world, PlayerEntity player, Hand hand) {
world.setBlockState(new BlockPos(1, 1, 1), Blocks.DIAMOND_BLOCK.getDefaultState());
return super.onItemRightClick(world, player, hand);
}
}