Posted March 27, 201411 yr Hey, I tried to make an simple item, that executes a command when you right click. The command is stored as NBT data. It is for mapmakers, so it's only obtainable through the /give with NBT data tags. The item should work like a portable command block. Everyone can use it, even if he doesn't have the necessary rights to execute the command manually. But the only one who is able to create and hand out these items is the admin because he is the only one that can use the /give command. Now to my problem. IĀ overrode the onItemRightClick() method. Here is my code:Ā https://gist.github.com/VoidCatz/3be9f4b44d1334c20e67 (Gist) The problem is that the command is executed twice when I right click. The other problem is that non-op players can't execute op commands. How can I solve these problems? Edit 1: The execute twice issue works now... I had to test if(!world.isClient()) To solve the other issue I will have to look into the abstract class CommandBlockLogic... I hate obfuscated code...
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.