#backpack
1 messages · Page 1 of 1 (latest)
also why i can't put items with nbt?
ofc its possible to fix start with 1 instead of 0
you can just doing it wrong prolly cuz nbt is picky
set {_n} to nbt of tool of {_p}
loop items in current inventory of {_p}:
set {_s} to index of loop-slot
set {_i} to full nbt of loop-slot
set tag "Slot" of {_i} to {_s}
add {_i} to {_items::*}
set {_size} to size of {_items::*}
set compound list tag "Backpack;Items" of {_n} to {_items::*}``` can't understand "set tag "Slot" of {_i} to {_s}"
it needs tag type
idk which tho
something like int/string/long tag
just try em all ig
there is a list on wiki
if name of player's inventory is "&8Backpack":
if event-item is chest:
cancel event``` and for this one? works fine but if i have a chest and i press 1 on the backpack gui the event is not cancelled
well yeah shortcuts are buggy
you could just drop it out of there when people close backpack
how
id start with on inventory close event
then?
i think you can stop it with this https://skripthub.net/docs/?id=10123
Called when an entity or block (e.g. hopper) tries to move items directly from one inventory to another.
When this event is called, the initiator may have already removed the item from the source inventory and is ready to move it into the destination inventory.
If this event is cancelled, the items will be returned to the source inventory.
you might need reflect actually
how do i drop the chest if the backpack contains one?
if name of player's inventory is "&8Backpack":
loop player's inventory:
broadcast "%loop-value%"``` i want to loop only the items in the backpack gui
event-inventory
can't understand this condition "loop event-inventory:"
if name of player's inventory is "&8Backpack":
loop items in event-inventory:
if loop-item contains chest named "&cBackpack":
broadcast "%loop-value%"``` ok i did but i want to drop that item with nbt on the ground
how do i do that?
but how do i drop the same item with the nbt and everything?
nope it doesn't contain the items in the backpack
i just get a chest named &cBackpack
if name of player's inventory is "&8Backpack":
loop items in event-inventory:
if loop-item contains chest named "&cBackpack":
drop loop-item at player's location```
Try name of loop-item = …
if name of player's inventory is "&8Backpack":
loop items in event-inventory:
if all:
loop-item is a chest
name of loop-item is "&cBackpack"
then:
drop loop-item at player's location```how to set the slot where the loop-item is to air without doing another loop?
probably loop a number of times
and then use slot (loop-number - 1) of event-inventory
if name of player's inventory is "&8Backpack":
loop items in event-inventory:
loop integers from 0 to 8:
if all:
loop-item is a chest
slot (loop-number) of event-inventory is chest:
then:
drop loop-item at player's location
set slot (loop-index) of event-inventory to air``` doesn't work
also just do loop 9 times
I could do something like this? set slot (integers between 0 and 8) of event-inventory where [imput contains chest] to air
But it's gonna work just like the loop does?