Posted April 7, 20223 yr 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); } } Edited April 7, 20223 yr by moneybanned
May 7, 20223 yr Author You must check that you are on the server first, only set blocks on the server. And how do I do that ?
September 12, 20232 yr complete nonsense stop copying information from forge's website how should it work in your opinion
September 12, 20232 yr a method that allows you to use what you want is called UseOn(), maybe a little differently NOT onItemRightClick
September 12, 20232 yr 2 hours ago, Elemental said: the problem is that if(!world.is Client Side) red is Client Side) red if(!player.getLevel.isClientSide)
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.