Giving players items

Discussion in 'Plugin Development' started by beastman3226, Oct 29, 2013.

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

    beastman3226

    I know how it can be done but I have found several issues that need to be addressed.

    First, I have more than 54 items to be given.
    Two, the inventory of the player is full or does not have enough slots to hold the items to be given.

    Can anyone offer some work arounds?
     
  2. Offline

    AndyMcB1

    such as?
     
  3. Offline

    beastman3226

    I have an item requisition, I am going to give it to the player. However the player ordered 55 stacks of wool and another stack of cobble. I thought about making a chest only accessible by the player. The problem with that is that I don't know how to create a chest at the given location (2 blocks infront of the player).

    A virtual inventory doesn't work because it is limited to 54 slots.
    AndyMcB1
     
  4. Offline

    i3ick

    Why don't you pull the players location and place the chest at it?
     
  5. Offline

    beastman3226

    i3ick
    I don't know how to create a block representation of the chest. I wouldn't know how to get the inventory of the chest to change it. Lastly, the inventory would still not be big enough.
     
  6. Offline

    i3ick

    Hmm. I would do it like this:

    if (player inventory isn't full){
    give items
    }
    else{
    sendmessage to target "Empty your inventory, player <cmnd sender> wants to give you some items"
    }
     
  7. Offline

    beastman3226

    i3ick
    That only works if the ItemStack[] I am trying to give has length less than 54.
     
  8. Offline

    i3ick

    @beastman3226
    If I understand right, You want to give someone lets say 200 items, but it only lets you give 54?

    If that's the case just pull the argument from the command issued and divide it by 54. This will give you the amount of stacks that need to be given so you can work with that, make the statement repeat or similar.
     
Thread Status:
Not open for further replies.

Share This Page