Jump to content

daniel0916

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by daniel0916

  1. Thanks. Perfectly working . So only one last question: How can i execute a command with forge? I understand how to send chat messages but i don't find something for commands.
  2. Okay, but the event doesn't get called. @SubscribeEvent public void onItemUse(PlayerUseItemEvent event) { System.out.println(event.item.getItem()); System.out.println(Item.getIdFromItem(event.item.getItem())); } MinecraftForge.EVENT_BUS.register(new Events()); "This event is separated in sub-phase events, make sure you picked right one." What do you mean with this exactly? Edit: Ah, okay. I understand it now. Edit2: Okay, the event is working when i block with the sword but i need a event which get called when i make right-click with a compass.
  3. When i have a item in my hand and right click the event should be called. So mouse click.
  4. public int getRequiredPermissionLevel() { return 0; } Fixed my problem. And can i use a event for right clicking with an item? client-side?
  5. Do I need to overwrite canCommandSenderUse?
  6. Big thanks. That's working. Now, i only have a permission problem. Maybe i can find the solution with searching .
  7. Yes, but then the mod needs to be installed on the server or? But i want to have this command only client-side. I only had modified minecraft directly with mcp before...
  8. Okay, it works. But it's the wrong event. Which event can i use for getting the command who is a player executing on a server. When i connect to a server and make "/test" the event should be called.
  9. Hello guys, i'm a beginner in Forge Development and i have a problem with using events. Code: @Mod(modid = Test.MODID, version = Test.VERSION) public class Test { public static final String MODID = "Test"; public static final String VERSION = "1.0"; @EventHandler public void init(FMLInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new CommandListener()); //FMLCommonHandler.instance().bus().register(new ExecuteEvent()); } } public class CommandListener { public void onCommand(CommandEvent event) { System.out.println(event.command); } } I don't get the message. What's wrong? Thanks for reading my question. Greetings Daniel
×
×
  • Create New...

Important Information

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