So I'm asking for help again.
I'm trying to make a stash system similar to hypixel's and I cant come up with how to make it. Here is my current code:
Now this works, but only if the whole stash fits in the inventory, which could get problematic quickly.
So in my server, I have disabled item dropping to prevent players from loosing their tools, which may make the game unplayable in the event they do. So in the event a player's inventory is full, I won't be able to add important items to their inventory (such as quest items, etc.) which is the reason I need to have a stash system.
If useful, here is a snippet of the code that actually adds the item to the stash
And it works perfectly.
In short, I need the first snippet of code to be able to give the players only what they can fit in their inventory from their stash.
I'm trying to make a stash system similar to hypixel's and I cant come up with how to make it. Here is my current code:
JavaScript:
command /stash:
aliases: /pickupstash
trigger:
if {stash::%player's uuid%::*} is set:
if player has enough space for {stash::%player's uuid%::*}:
send "&aʏᴏᴜ ᴄʟᴀɪᴍᴇᴅ ʏᴏᴜʀ ѕᴛᴀѕʜ!" to player
send "%{stash::%player's uuid%::*}%" to player #debugging code
give player {stash::%player's uuid%::*}
clear {stash::%player's uuid%::*}
play sound "block.note_block.pling" at volume 1 at pitch 2 to player
else:
send "&cʏᴏᴜʀ ɪɴᴠᴇɴᴛᴏʀʏ ᴅᴏᴇѕɴ᾽ᴛ ʜᴀᴠᴇ ᴇɴᴏᴜɢʜ ѕᴘᴀᴄᴇ!" to player
play sound "block.note_block.pling" at volume 1 at pitch 0 to player
else:
send "&cʏᴏᴜʀ ѕᴛᴀѕʜ ɪѕ ᴇᴍᴘᴛʏ!" to player
play sound "block.note_block.pling" at volume 1 at pitch 0 to player
Now this works, but only if the whole stash fits in the inventory, which could get problematic quickly.
So in my server, I have disabled item dropping to prevent players from loosing their tools, which may make the game unplayable in the event they do. So in the event a player's inventory is full, I won't be able to add important items to their inventory (such as quest items, etc.) which is the reason I need to have a stash system.
If useful, here is a snippet of the code that actually adds the item to the stash
Code:
wait 0.5 second
send "&2" to player
if player has enough space for wooden pickaxe:
give player 1 of unbreakable wooden pickaxe with no nbt with name "&7Stone Pickaxe [1]" with lore "&8Farmer Joe's old pickaxe" and "&7"
send "&a&l+ &7Stone Pickaxe [1]&7" to player
else:
add 1 of unbreakable wooden pickaxe with no nbt with name "&7Stone Pickaxe [1]" with lore "&8Farmer Joe's old pickaxe" and "&7" to {stash::%player's uuid%::*}
send "&c!ʏᴏᴜʀ ɪɴᴠᴇɴᴛᴏʀʏ ɪѕ ꜰᴜʟʟ! ᴅᴏ /ᴘɪᴄᴋᴜᴘѕᴛᴀѕʜ ᴛᴏ ɢᴇᴛ ʏᴏᴜʀ ɪᴛᴇᴍѕ!" to player
And it works perfectly.
In short, I need the first snippet of code to be able to give the players only what they can fit in their inventory from their stash.