#(Wrackspurt) take item from inventory with specific nbt

1 messages · Page 1 of 1 (latest)

young zodiac
#

Hi, is there a way to use the "take" command to take items with a specific nbt?
for example if I wanted to take any items with the nbt "oraxen:id=banana;" how would I do this with the take command?

unreal marshBOT
#

(Wrackspurt) take item from inventory with specific nbt

unreal marshBOT
#

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.

warm obsidian
#

!c take

acoustic impBOT
# warm obsidian !c take
Group

item

Syntax

take [iteminhand/cursoritem/bydisplay:<name>/bycover:<title>|<author>/slot:<slot>/flagged:<flag>/item:<matcher>] (quantity:<#>) (from:<inventory>)

Short Description

Takes an item from the player.

Description

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...

warm obsidian
#

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.

young zodiac
#

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

warm obsidian
#

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.

long prawn
#

Just hold it in ur hand and narrate the nbt

snow plover
#

Why dont you make the item via denizen? Then you can take it with the command.
Very simple

long prawn
long prawn
#

!t inventory.map_slots

acoustic impBOT
long prawn
#

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

young zodiac
young zodiac
long prawn
#

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

warm obsidian
long prawn
#

I also rewrote that code like 5 times so I just left the define as it was the previous version

warm obsidian
#

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.

long prawn
#

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

nova pumice
#

Feel free to ask if you need any more help, otherwise

brazen hullBOT
#
Thread Closing Reminder

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