#(danjoe3) Filter items

55 messages · Page 1 of 1 (latest)

ivory spindle
#

Hey there,

I'm currently trying to create an item filter system using a Task script for the UI on which I'm currently working. I'm a bit stuck at this point and don't know how to go on about it. I would really like some help. I know it's wrong, but would like to know the working behind it :))

https://paste.denizenscript.com/View/120628

whole trailBOT
#

(danjoe3) Filter items

whole trailBOT
#

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.

ivory spindle
#

So basically, what happens is, when a player clicks an item within the inventory, It runs this task and it filters only crops and farming items that are within minecraft and displays that in the UI

daring whale
#

I see the proc takes in a ListTag(ItemTag)? what exactly is it meant to return? whether every item in the list is a farming item?

shut swan
#

Correct me if I am wrong, but line 12 never runs. Determine stops the queue.

ivory spindle
#

I kept it as a task thinking the determine true might work

ivory spindle
#

I think I figured out the filter aspect, but the <[item]>.vanilla_tags seems to be invalid

daring whale
#

Ah it's a task not a proc - I see it creates a definition, is it meant to be used via inject then?

#

Seems like something a proc would work well for honestly,
- define validItems <[allItems].proc[filter_farming_items]> or something like that

ivory spindle
ivory spindle
#

Cuz I got the filter system to work using the task, it’s just the vanilla_tags aspect that doesn’t seem to work 🤔

daring whale
#

I mean, procs are just cleaner/more suited for these sort of things - with a task I'd need to be something like

- ~run filter_task def.items:<[items]> save:filter_task
- define filtered_items <entry[filter_task].created_queue.determination.first>

vs procs

- define filtered_items <[items].proc[filter_items]>

Or something along these lines

#

But either way if something in your script doesn't work than

#

!debug

steep sedgeBOT
# daring whale !debug
Info: debug

If you need help with a script issue, one of the most powerful tools Denizen has to offer is full debug output. This is displaying in your console whenever scripts are running until you turn debug off. To share a debug log quickly and easily with helpers, simply run the command /denizen debug -r in-game to begin recording, then run through the part of the script you need help with, then run the command /denizen submit. This will give you a link to a paste of the debug log, which you can then copy/paste back to us!

ivory spindle
ivory spindle
ivory spindle
#

So this is the debug

#

I'm creating an auction house system

#

Where I'd like to filter out the items accordingly within the UI

#

So far the Hoe's get filtered out

#

But the material.vanilla_tags doesnt seem to

#

It mentions this The returned value from initial tag fragment '[item]' was: '[item].with_flag[expire_after].duration[24h]'.

ivory spindle
#

Have I written the flag expire wrong?

ivory spindle
#

I think I;ve somewhat fixed it, but certain tags within the crops vanilla_tags dont seem to filter out

#

And there doesnt seem to be any errors

hardy pawn
#

your issue with the whole crops thing is because technically planted crops and crop items are 2 seperate materials

#

for instance, when its just an item in hand its carrot but the planted stuff on the ground is carrots

#

the planted one in the ground is the one that has crops

ivory spindle
#

Oh

#

So would you recommend that I just use the villager_plantable_seeds tag?

#

Or is there another way to do so?

hardy pawn
#

maybe, but that doesnt cover wheat

ivory spindle
#

Or would I have to create a data script with all the farming items?

#

And sort them out based on that?

hardy pawn
#

i would say perhaps data script is the way to go for this, just due to there not being an easy vanilla tag for this

ivory spindle
#

I see

hardy pawn
#

they might add one in the future, they keep adding new ones every update

ivory spindle
#

Would this also be the same case for the other filters? Like blocks?

#

Minerals?

hardy pawn
#

blocks generally dont have this problem

#

this is unique to crops due to how they work

ivory spindle
#

So basically a list of what all I'm sorting out are, blocks, farming things, gear, enchantment books, minerals, and an other section, that doesnt include in any of the lists mentioned

#

I'm wondering how the other filter task would look?

hardy pawn
#

I mean.. wouldnt other just be the else part of the filter?

ivory spindle
#

True, my bad!

#

Thank you! I'll just keep this open if I have any issues!

ivory spindle
#

For the blocks, which tag would you recommend?

ivory spindle
#

So I have this doubt, when a player clicks a certain item within the inventory I;d want to check if slot 54 has the item flag check. If it does, then I'd like to continue with the script, else stop