Solved MobArena extensions: Giving Items on start does not works.

Discussion in 'Plugin Development' started by Flyverse, Sep 18, 2013.

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

    Flyverse

    Hi!
    I tried to develop a little addon for mobarena, but became stuck. I want to give some players specific items on starting the arena: The event is called correctly, but it fails at player.getInventory().addItem(itemstack); - The item just isn't added. Why? And how could I fix this?
    Kindly regards
     
  2. Offline

    chasechocolate

    Post your method. Also, do you have @EventHandler and did you register the events?
     
    tommycake50 likes this.
  3. Offline

    Flyverse

    Yep. As I said: I debugged everything.
     
  4. Offline

    chasechocolate

    Flyverse try giving the items in a 1-tick delayed task?
     
    Flyverse likes this.
  5. Offline

    Flyverse

    Works - Thanks!
     
  6. Offline

    EdenCampo

    Flyverse

    player.updateInventory(); should probably work also.
     
  7. Offline

    Flyverse

    EdenCampo
    "updateInventory()" is deprecated, so I better don't use it ;)
     
  8. Offline

    tommycake50

    Yes but until inventory glitches are fixed it must be used.
    When bukkit do remove it if inventory glitches are still there i will flip a table but until then use it as much as you like.
     
Thread Status:
Not open for further replies.

Share This Page