Solved Red 0s after saving itemstacks to config and calling upon them into player's inventory

Discussion in 'Plugin Development' started by TheWolfBadger, Jul 11, 2015.

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

    TheWolfBadger

    [​IMG]
    This happens after saving the inventory of the player into a config while they are in creative and got the items from the creative menu. I need them to be the same as the player's inventory and not have these 0s though. Does anyone know what could be causing this? Thank you.
     
  2. Offline

    teej107

    @TheWolfBadger What version of Spigot or CB are you using? I never have had that problem but I've seen it done intentionally and was wondering how they did that.
     
  3. Offline

    TheWolfBadger

    @teej107 1.8.3, spigot isn't supported here
     
  4. Offline

    teej107

    @TheWolfBadger It is actually. Recent rule change has happened. Try it on a different version and maybe CB.
     
  5. Offline

    TheWolfBadger

    Figured out the red 0s are actually where the amount of the item would be and it is registering the items as 0 setAmount, I don't know why... Any ideas?
     
  6. if (itemStack.getAmount < 1) itemStack.setAmount(1)
     
  7. Offline

    TheWolfBadger

    @FisheyLP I tried setting the amount of each item as 1 before I sent them to config, but it still didn't fix my problem. Don't know why. I will try it again though.
     
Thread Status:
Not open for further replies.

Share This Page