#Which runs better?
1 messages · Page 1 of 1 (latest)
functions run faster
It really depends what you're trying to do. If you're always going to do all of the commands then a function file might be faster. But well written JavaScript can be much faster in many cases
it's pretty much a block that crafts based on sacrifices on it, and each unique sacrifice gives it a special tag to identify the ingredients, and I gotta scan the tags to make the crafting compelte. So i'd use a script event and the hasTag() method
so ig im asking if /execute if entity @e[tag=(tag)] is faster than entity.hasTag("tag")
Read docs try find out
Tbh u porbably wont notice much of a difference
"Most things you could do in a function can be done in a script, but not everything because there are some differences. Functions can be faster because you don't need to go to get the disk and load a separate file (the function is already in memory when you call it), and because it runs in the existing process where a separate script will run in a subshell."
true but I have had issues where large function files cause massive lag spikes
so functions are better bc they get preloaded
but scripts can do more stuff
for what im doing I only need tag scanning