Help, GUI Plugin

Discussion in 'Plugin Development' started by turbobee45, Dec 31, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    elraro

    After
    event.getPlayer().getInventory().addItem(new ItemStack(Material.COMPASS));

    Add:
    event.getPlayer().updateInventory();
     
  2. Ok thanks ill give it a go.

    Has not worked :/

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 31, 2016
  3. Offline

    SuperOriginal

    @turbobee45 Your onEnable has a typo, so your events aren't getting registered.
     
  4. Thank you, cant believe I missed that. For some reason still not working though??
     
  5. Offline

    SuperOriginal

    - Post current code
    - Make sure your plugin was exported/updated correctly
     
  6. @turbobee45
    try event.getPlayer().updateInventory();
     
  7. @turbobee45 This event works for me, make sure you exported and updated your (test)servers jar correctly. Stop the server, replace jar, delete datafolder. Going to check your code now if you have some errors there, but it's hard to get through that code, you code on a very different way than me. :D
     
  8. @Lionhard Okay, I re exported the jar file and overwrote the .jar file, I then stopped and restarted my server and my minecraft client. And I still have no compass. Also im probably being stupid but what is a datafolder/where can I find it?
     
  9. @turbobee45 datafolder = the folder that is created when you have some configs in your plugin. eg /plugins/MyPluginName/config.yml - MyPluginName is the datafolder.

    before onEvent do public static InventoryClick plugin;
    and where
    getServer().getPluginManager().registerEvents(this, this); is, use
    this.getServer().getPluginManager().registerEvents(this, this);
     
  10. @Lionhard This is the updated code: http://hastebin.com/ekoyawiyaq.avrasm
     
  11. @turbobee45 Did you check for errors? Post stack trace is any. Is the plugin even enabled? And PLEASE, sacrifice 2 additional lines of code and make proper if-statements... Those ones drive me crazy :D
     
  12. I've checked the console and It is enabled and if you mean error messages when you say stack trace there are no console errors.
     
  13. Offline

    ESSHD

    If you did not see: Where you register your event the onEnable() has a typo.
     
Thread Status:
Not open for further replies.

Share This Page