Drop Items when Inventory is full, when giving to the player #289

  • Defect
  • OwnMakesChannel created this issue May 27, 2021

    I give a player an iron sword as a reward. It does not give anything to the player, if the inventory is full. I use this function


    - '%PlayerOptions%addItem: IRON_SWORD:1'


    Can you just drop the item infront of the player?

  • OwnMakesChannel added a tag Defect May 27, 2021
  • ivanfromitaly posted a comment May 29, 2021

    You should check the inventory size before giving him the item, and if there is an empty spot, you can give the item. To drop it in front of the player, you should "spawn" the entity on the ground, and i don't think there is anything for that currently available.

  • OwnMakesChannel posted a comment May 31, 2021

    Hmm... I was a bit surprised that it didn't work, because I think the Quests Plugin supports this. It automatically checks for space in the inventory and drops the item infront of the player, if the inventory is full.

  • Caley19_ posted a comment Jul 4, 2021

    You could use essentialsX's /give command and enable this feature created specifically for this scenario in the essentialsX's config:

    "# Shall we drop items instead of adding to inventory if the target inventory is full?
    drop-items-if-full: true"

    I hope you use essentials since every survival server that doesn't have their own devs to build all basic comands uses it. Also the give message in the chat wont show to the player who is given item if you run the /give command as $RUN_CONSOLE.

To post a comment, please login or register a new account.