#(Wrackspurt) take item from inventory with specific nbt
1 messages · Page 1 of 1 (latest)
(Wrackspurt) take item from inventory with specific nbt
Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
!c take
item
take [iteminhand/cursoritem/bydisplay:<name>/bycover:<title>|<author>/slot:<slot>/flagged:<flag>/item:<matcher>] (quantity:<#>) (from:<inventory>)
Takes an item from the player.
Takes items from a player or inventory.
If the player or inventory does not have the item being taken, nothing happens.
Using 'slot:' will take the items from that specific slot.
Using 'flagged:' with a flag name will take items with the specified flag name, see !language flag system.
Using 'iteminhand' will take from the player's held item slot.
Using 'cursoritem' will take from the player's held cursor item (as in, one that's actively being picked up and moved in an inventory scree...
Hmmm.
You may have to write a procedure to find items with a specific nbt if it's a specific nbt.
And return it's slot as well.
Im able to use the specific nbt thingy pretty much everywhere else so I was hoping to use it for the take command too, but I can't figure it out
As said, you'll probably have to write a procedure that checks the inventory for a specific nbt, and then returns the slot so you can - inventory take slot:<[slot]>
Although if you're looking for multiple then you'll have to compensate.
Can you share what the nbt on the item looks like?
Just hold it in ur hand and narrate the nbt
Why dont you make the item via denizen? Then you can take it with the command.
Very simple
This is the best solution to the problem but it's not always an option
Returns a map of inventory slots to the items in those slots (excludes air).
properties
MapTag
Can use that to go through all the items in the inventory and check for nbt ^
Here I think this can help you out #1153979526674644992 message
You'd have to change the nbt check but that'd return a map with slots as keys and your matched oraxen items as values
Er also you probably want a null check, idr if filter value hides errors
sec
find_items:
type: procedure
definitions: inventory|id
script:
- define item_map <[inventory].map_slots>
- determine <[item_map].filter_tag[<[filter_value].raw_nbt.deep_get[itemsadder.id].if_null[null].equals[<[id]>]>]>```
Still check the original thread for some context
Its an item that comes from oraxen blocks and stuff, i think it would just complicate things more
I did see this when I was searching actually, but i wasnt sure how to make it work for oraxen things
er try changing itemsadder.id to PublicBukkitValues.oraxen:id
Then if you were do to something like <player.inventory.proc[find_items].context[string:oraxen_id]> it should return all the items that match the id you fed it
Why define and then determine when you can just determine?
Personal preference I don't like long lines (well the second one is long as heck but you can't really help that)
I also rewrote that code like 5 times so I just left the define as it was the previous version
Eh, fair enough. I like having less lines so I guess it's personal opinion, although I do wonder the very very micro optimization it would make to have it be one line determination.
OH lol I just got what you mean
When I was writing the code for this I was playing around with it as first and checked the definition a bunch of times instead of straight up determining it
When I finished the code I just kinda forgot about it
There fixed it o7
Feel free to ask if you need any more help, otherwise
Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.
If not yet resolved, please reply below to tell us what you still need.
(Note that if there is no reply for a few days, this thread will eventually close itself.)
@young zodiac