#Help with Predicates

1 messages · Page 1 of 1 (latest)

queen fjordBOT
#

Hey there, I was wondering if I could get some help understanding predicates.
I haven't used them before (cuz I didn't know they were a thing).
As I understand it though, it's basically like a filtered selector method similar to adding tags to blocks or entities.

So instead of doing execute as @a[scores={whatever=0},tag=test_tag,nbt={SelectedItem:{idminecraftstick,nbt:{item_nbt:1b},Count:1}} run function namespace:folder/example
I could do: execute as @a if predicate namespace:example_predicate run function namespace:folder/example

But I need a bit of direction on how to set it up. I am having trouble understanding the wiki on this.

candid crystalBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

🙇 After a while, hit the Summon Helpers button to ping the helper team. They'll be happy to help you

✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve

shy bison
#

It’s best used in addition to a selector, as a selector filter, so @a[predicate=namespace:path/to/file]

#

Also, don’t use it to replace tags or types, those make the selector more efficient

#

Even more efficient then checking that through a predicate

#

But stuff like - checking what item is in your mainhand should be faster using predicates

#

And other stuff - like if you are burning or anything is only possible to check via predicate

#

I suggest playing around with misodes generator to get a feel for what they can do

slim escarpBOT
#
**📖 Misode**

Awesome website with generators for almost everything. Also contains a technical changelog for new versions, guides on how to use some features, a performance report inspector and more!

Full list of generators: Loot Tables, Predicates, Item Modifiers, Advancements, Recipes, Text Components, Damage Types, Chat Types, Trim Materials, Trim Patterns, pack.mcmetas, Dimensions, Dimension Types, Biomes, Configured Carvers, Configured Features, Placed Features, Density Functions, Noise, Noise Settings, Structures, Structure Sets, Processor Lists, Template Pools, World Presets, Flat World Presets, World Settings, Block Tags, Entity Type Tags, Fluid Tags, Game Event Tags, Item Tags, Biome Tags, Structure Tags, Blockstates, Models, Fonts, Atlases

Link: https://misode.github.io/

rough sonnet
shy bison
#

Anything that has a dedicated slot in the predicate - so mainhand offhand and the armor slots should be faster

#

But not by very much, since you still need to do nbt checks

rough sonnet
#

Hey, better performance is better performance at this point 😛
My project is pretty large so I'm doing everything I can to speed it up lol.
I'm checking out misode now. I appreciate your help.