Тёмный

How to Optimize Your Datapack 

Cloud Wolf
Подписаться 32 тыс.
Просмотров 20 тыс.
50% 1

We cover some common methods to make your datapacks run faster.
⚔️ Server IP: cloudgames.ml
🔵 Discord Server: / discord
💻 Website: dtdeadpool.wixsite.com/cloudg...
🐺 Twitter: / cloudwolfbane
📧 Email: dt.deadpool@gmail.com
Music:
"Werq" Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 4.0 License
All Songs Used under fair copyright. Lincenses Below:
License for commercial use: Creative Commons Attribution 3.0 Unported "Share Alike" (CC BY-SA 3.0) License.
Full License HERE - creativecommons.org/licenses/...

Игры

Опубликовано:

 

7 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 132   
@IJAMinecraft
@IJAMinecraft 4 года назад
This is a very useful video, and a lot more in depth than I expected! Somehow I kind of overlooked the schedule command until now and forgot about its existence 😅
@Cl0udWolf
@Cl0udWolf 4 года назад
IJAMinecraft ya it is like a repeater in a datapack, and just as useful!
@pp8818
@pp8818 4 года назад
hello IJA
@liam8398
@liam8398 4 года назад
Using /schedule is like an addiction, things are so much easier when you need a pause between functions.
@cubedeveloper9504
@cubedeveloper9504 4 года назад
Yeah same for me, I always used scoreboard timers 😅
@redpug5042
@redpug5042 4 года назад
@@Cl0udWolf i didnt even know /schedule existed
@trilo_boy
@trilo_boy 4 года назад
i thibk, this is the only video in youtube how to optimize ur datapack
@Cl0udWolf
@Cl0udWolf 4 года назад
haha cool
@fishybusiness1149
@fishybusiness1149 3 года назад
mumbo: *sees tip 1* mumbo has left the chat
@boltstrikes429
@boltstrikes429 4 года назад
didn't know i should be using AEC's instead of armor stands... that explains why one of my maps with 250 armor stands was unplayable :P
@Cl0udWolf
@Cl0udWolf 4 года назад
would probs go from unplayable to full speed XD
@NOPEnameMC
@NOPEnameMC 4 года назад
Me: *makes a virtual computer using a datapack that runs extremely fast* Also me: *likes to use redstone in his adventure map*
@Cl0udWolf
@Cl0udWolf 4 года назад
hehe ya i actually use 0 command blocks nowadays and its super awkward feeling at first but very satisfying
@NOPEnameMC
@NOPEnameMC 4 года назад
​@@Cl0udWolf Yeah, most of the time I like having a datapack as well. Another big advantage next to performance is, you can find your stuff a lot easier! But sometimes I just want to build a small redstone contraption xD
@TristanPopken
@TristanPopken 4 года назад
@@NOPEnameMC Same! i love to make small redstone/command block contraptions like an elevator or something normally but when i make a huge datapack like my Custom Stronghold generator i really do need to use datapacks
@mattomanx77
@mattomanx77 3 года назад
Thank you for these! Immediately started noticing the performance improvements.
@rewindcat7927
@rewindcat7927 4 года назад
Amazing thank you so much. That AEC tip is priceless. Thanks again.
@liam8398
@liam8398 4 года назад
Great video! Something I learned that is useful when you need to check entities/items is to give them a specific tag, so they won't be checked again and this will improve performance, since the selectors checked every tick will decrease.
@gingerdude3666
@gingerdude3666 2 года назад
this saved me from a very laggy datapack. the 'chunking' of functions has helped me immensely, especially with bosses.
@NOPEnameMC
@NOPEnameMC 4 года назад
Function trees is basically how I made the MC64. The datapack is >90% function trees xD
@Beetless
@Beetless 3 года назад
what does function tree mean
@NOPEnameMC
@NOPEnameMC 3 года назад
This video -> 2:41
@Beetless
@Beetless 3 года назад
@@NOPEnameMC thank you
@misode
@misode 4 года назад
Thanks for making this video :)
@lieutenantgonads
@lieutenantgonads 4 года назад
Wow I never thought of a self rescheduling function for a clock. Before, I would just give a fake player a score and keep resetting it every second while executing different parts of the datapack based on the score
@kayathemaya8971
@kayathemaya8971 4 года назад
Thank👏you👏so👏much👏!
@cubedeveloper9504
@cubedeveloper9504 4 года назад
Thanks for the useful tips :D
@Reqaug
@Reqaug 4 года назад
Thanks for this very informative video!
@SAMEER_99
@SAMEER_99 2 года назад
Thank you so much. It really helped me.
@novopotato
@novopotato 4 года назад
Underrated
@elygolden
@elygolden 4 года назад
Great points! A few things worth mentioning: Take care when using the /execute command to run functions. executing a function as multiple entities multiplies the number of commands the function uses by the number of entities executing it. This means that doing this could cause the chain length to grow beyond the limit, which could have unintended consequences. AECs have a maximum lifetime, so if you have entities that your datapack requires to be persistent, it is usually better to use armour stands (2,147,283,648 ticks is about 3.5 years, but it's always good to be prepared). Otherwise, AECs are indeed better.
@Cl0udWolf
@Cl0udWolf 4 года назад
Ely Golden ya I agree but that doesn’t really hav to do with optimization. Doing execute and using a sub function if operating properly will save u space, sure it runs the function once per entity that matches requirements But if that was ur intended purpose then it’s better than doing the same thing but making it multi lines like: execute as @a run say hi execute as @a run say yo execute as @a run say ye Still says hi for each player But if u made it execute as @a run function say hi say yo say ye Would still be way faster cause u don’t use the selector twice and runs the same amount of commands + 1 to start the function. Basically what I mean is under 0 circumstance is it better to break lines that run the same selector and what u suggest seems to oppose that, if not then it suggests the user doesn’t understand how their code works and probs didn’t optimize selectors
@Beetless
@Beetless 4 года назад
One of your best videos I think
@Cl0udWolf
@Cl0udWolf 4 года назад
Beetless thx I put more time into the recording aspect
@-penguinify
@-penguinify Год назад
Thank you!
@coolcat2656
@coolcat2656 Год назад
Wish I found this earlier, will recc to friends
@supericeg5913
@supericeg5913 Год назад
There is a bunch of stuff I will definitely try. I think me letting all my timings scoreboards do their own thing falls in two of these categories.
@sajeucettefoistunevaspasme
@sajeucettefoistunevaspasme 5 дней назад
Top 10 useful advices
@koorikitsune38
@koorikitsune38 3 года назад
To see AECs I normally use the "composter" particle on repeat, but it's just for debugging and stuff.
@talwat321
@talwat321 2 года назад
why the composter particle? why not something like flame or whatever
@koorikitsune38
@koorikitsune38 2 года назад
@@talwat321 It's so they vanish faster than the other ones... in 1.17 I believe another could be electrical sparkle or whatever
@kazii_the_avali
@kazii_the_avali 10 месяцев назад
i would love to see an update to this. i know a few things has change such as the new entity for markers is the marker entity (witch will mark a posision)
@Izzy.256
@Izzy.256 3 месяца назад
just realized i'm gonna have to rewrite my ENTIRE datapack... oh shit...
@BisUm3
@BisUm3 4 года назад
How to Optimize Your Datapack? Learn Scarpet and use it!
@Cl0udWolf
@Cl0udWolf 4 года назад
Scarpet is useful but not maximally optimized. Like it isnt as free to adjust as doing it urself with actual datapacks and most people dont want to learn something new when they already know commands
@Beetless
@Beetless 4 года назад
What is scarpet
@Cl0udWolf
@Cl0udWolf 4 года назад
@@Beetless kinda like a coding language / program for mc stuff
@Beetless
@Beetless 4 года назад
Cloud Wolf but it needs a mod to use?
@Cl0udWolf
@Cl0udWolf 4 года назад
Beetless it is a mod in a way it’s a language that I think compiles to a datapack
@Inspirator_AG112
@Inspirator_AG112 4 года назад
I had a *Datapack* where [I was making "invulnerable blocks" (-This was not what it was about.) by putting *Falling Blocks* in the location of *Barriers* so these blocks are impossible to mine.], but I noticed the *TPS* slowly lowering if I got far away from these "invulnerable blocks". If I got close again after having low *TPS,* the *FPS* would spike to zero. Using *"say @e",* the *chat* would return "Falling Block, Falling Block, Falling Block ...". Using *"/kill @e[type=falling_block]",* the *chat* would return "Killed [A 5-digit number of] entities.". I thought *Falling Blocks* _always_ lasted 1 *tick* (-Or 0.05 seconds).
@0x2480
@0x2480 4 года назад
I would make it kill the falling blocks then spawn them, It should reduce lag.
@themcscripter2111
@themcscripter2111 4 года назад
0:53 mumbo jumbo please look away.
@Cl0udWolf
@Cl0udWolf 4 года назад
TheMC Scripter ya I did that on purpose to prove a point
@themcscripter2111
@themcscripter2111 4 года назад
Cloud Wolf indeed. I’ve always thought mumbo should make minecraft coding videos. I personally think redstone is now outdated. Sure use redstone in survival worlds but creative worlds. Data packs are the way to go.
@themeninwhite195
@themeninwhite195 Год назад
The problem with the schedule command is that if the player quit during the delay between a function and another, the delay will reset. Idk if it's intended or it's a bug, but it's a serious problem. For exemple, i want a falling_block to not despawn after 30 seconds, so i could schedule a function every 25 or so seconds to optimize, but if the player just join the world for a few second the commend cannot run, and the falling_block will despawn the next time the palyer join. Also, now they added the marker entity which is really lag friendly, but it misses a lot of useful things like the possibility of having passengers, so area cloud effect could still be useful. The problem? It seems a spawned cloud area effect cannot be teleported, in any way
@connerduncan7411
@connerduncan7411 4 года назад
Due to the short circuiting of selector conditions, would you not need to place the type at the front instead of the back of the list in order to prevent the processing of tags or is this a special case based on the nature of the particular condition? What I wouldn't give for comprehensive documentation on details such as this.
@Cl0udWolf
@Cl0udWolf 4 года назад
Conner Duncan yes order matters I was just bulk recording stuff
@rewindcat7927
@rewindcat7927 4 года назад
I have stayed away from using schedule for repeating commands because I am concerned that if a tick goes wrong somehow, the whole repeating functionality is ruined. Never been able to really test its reliability, so my question is: have you ever had issues with the schedule not working? Thanks!!!
@Cl0udWolf
@Cl0udWolf 4 года назад
Rewind Cat schedule will always schedule lol the function is thrown on a stack even if u lag it is coming
@rewindcat7927
@rewindcat7927 4 года назад
Cloud Wolf that’s enough for me. Scheduled functions from now on! Thanks again!
@julianthaler2741
@julianthaler2741 4 года назад
Could you please make a whole video on "how to check blocks" because I am tired of checking all different blocks in Minecraft to find out what block it is and I don't know how to do the method you told me in this video
@Cl0udWolf
@Cl0udWolf 4 года назад
what do u mean like execute if block air ? or checking an area of blocks thats too vague
@aerbon
@aerbon 3 года назад
@@Cl0udWolf i think he is asking about how to fing out what exact block is at a given position
@superalvin7208
@superalvin7208 3 года назад
@@aerbon Data get?
@aerbon
@aerbon 3 года назад
@@superalvin7208 that only works on tile entities (dispensers, furnaces, etc.)
@AgentM124
@AgentM124 4 года назад
Which sublime syntax highlighter are you using? I got one through the package manager called MCC or something, but it's outdated.
@Cl0udWolf
@Cl0udWolf 4 года назад
Agent M function syntax highlighter
@roei900
@roei900 3 дня назад
in 1.16 and over you can use marker entity instade of AEC
@kindred408
@kindred408 2 года назад
Really love your videos and your tips are very useful. But how can you summon area effect cloud that don't disappear like 8:14?
@Cl0udWolf
@Cl0udWolf 2 года назад
Mostly irrelevant given marker entities r better placeholders
@kindred408
@kindred408 2 года назад
@@Cl0udWolf wow Thanks for the reply. I was not expecting to be that fast. When I summon area effect cloud it disappear. Is there a way to stop it from disappearing?
@Cl0udWolf
@Cl0udWolf 2 года назад
@@kindred408 use mcstacker.net but don’t use an area effect cloud unless u need it for potion stuff otw use a marker
@kindred408
@kindred408 2 года назад
@@Cl0udWolf Ok Thanks!
@tischregal9678
@tischregal9678 Год назад
I got a quick question, I have a function for sound repition in my Dp which executes 20/s every tick. It's basically like: -execute playsound if score=1 -execute if score @s =1 put score @s 200(lenght of the sound) -scoreboard player remove @s score 1 Would Making a schelude for that be much more Performance efficient or negligible?
@stanferrolino12
@stanferrolino12 Год назад
if the length of your sound (in ticks) can be divided by some kind of dividend (without any remainder), say, a sound length of 200 ticks can be divided by 20, then you can set both the scoreboard limit and a scheduling loop to follow that kind of formula. example: [200 tick sound = 20 tick loop * 10 scoreboard timer] Although oddly timed sounds might get cut off in the end. Depends on you though, some efficiency for just a tiny bit of overlap within your sound.
@simonbigras8915
@simonbigras8915 4 года назад
Do redstone blocks affect the proformance in my world, because i have a couple redstone blocks that appear/disapear once a player is in a zone?
@Cl0udWolf
@Cl0udWolf 4 года назад
Simon Bigras not really
@panr4in
@panr4in 3 года назад
So in essence, if I plan to have dozens of carrot on a stick items that will do abilities on right-clicks, just making a function with this long list of detections for all the various items and then adding a if entity @a[scores={active=1..}] (where "active" is the right-click detection) to my tick function, that will already help a lot yes? Since I'm only executing the long list of detections if a player right-clicked the carrot on a stick?
@Cl0udWolf
@Cl0udWolf 3 года назад
Yes and another bigger improvement Is making all info of what item it is on the same nbt tag which u use execute store to put on a score then do dozens of scoreboard checks instead of dozens of nbt checks so like {type:7} put 7 on the score if it’s 7 then do what it does
@panr4in
@panr4in 3 года назад
@@Cl0udWolf thx for the tips, also a side question, does it matter how many dummy scoreboard objectives are there in the world or should I not fear just making new ones for whatever I think is useful, even if it's for a small thing?
@Cl0udWolf
@Cl0udWolf 3 года назад
@@panr4in scoreboards do have an impact on performance and file size but it isn’t too big, just try not to store player specific scoreboard values too often especially if it’s for a server
@AgentM124
@AgentM124 4 года назад
I remember mojang saying that selectors parse and interpret orderedly. So tag, then type @e[tag=x,type=y] would still test tag first then type, however @e[type=y, tag=x] would do type then tag. Is that true?
@Cl0udWolf
@Cl0udWolf 4 года назад
Agent M probably I was just typing it out for visual
@maelstrom-mecharena-livest8078
@maelstrom-mecharena-livest8078 4 года назад
Cloud Wolf So is filtering on tag first faster because it reduces the total possibilities first, or should the type selector be used first? I guess ideally you’ll want to use just a tag so you don’t have to use type.
@MrHatoi
@MrHatoi 4 года назад
@@maelstrom-mecharena-livest8078 No, everything you said is the exact other way around. You put the type first because the game stores entities based on type, so it immediately throws out the 90% of entities that don't match the type without checking them at all. If you put the tag first, or only the tag, then it has to go through every entity in the world and check if the tag matches.
@maelstrom-mecharena-livest8078
@maelstrom-mecharena-livest8078 4 года назад
MrHatoi Thank you, that makes sense.
@Taruyroiii
@Taruyroiii 4 года назад
Hi! Thanks for the tips! I have a question, is there an easier way to make custom blocks than armor stands? Thanks!
@Cl0udWolf
@Cl0udWolf 4 года назад
Roi John Belmonte nope
@RewindNoob
@RewindNoob 3 года назад
try item frames
@lolicanadian
@lolicanadian Год назад
There is _now_
@pp8818
@pp8818 4 года назад
How did you now always what i need?
@slightlyniceron
@slightlyniceron 4 месяца назад
Markers are another great solution instead of AECs
@sofar2218
@sofar2218 4 года назад
i'm completely new to making datapacks, like i've never touched a function how do i transfer command blocks to a data pack, like i'm making a kit, for example, if a player sneaks for five seconds, they become invisible but as soon as they stopped sneaking, or they moved an inch, the invisibility goes away and you have to sneak again for five seconds to be invisible
@Cl0udWolf
@Cl0udWolf 4 года назад
owo u could just copy and paste repeating commands into the tick function but that wouldn’t be utilizing the advantages of datapacks and the things discussed in this vid
@sofar2218
@sofar2218 4 года назад
Cloud Wolf thanks♡
@daizzer
@daizzer 2 года назад
i need to know what are your plugins for Sublime text, i need that syntax highlighter
@Cl0udWolf
@Cl0udWolf 2 года назад
Arcensoth’s Mc function
@Inspirator_AG112
@Inspirator_AG112 3 года назад
If I summon ~10000 *Area Effect Cloud entities,* it still lowers, the TPS _severely._
@Cl0udWolf
@Cl0udWolf 3 года назад
AG112 VIDEOS well sure 1000 lbs of feathers weighs the same as 1000lbs of rocks
@clancysleepovergetyourblankies
@clancysleepovergetyourblankies 3 года назад
Why would you summon 1000 AEC tho?
@Inspirator_AG112
@Inspirator_AG112 3 года назад
@@clancysleepovergetyourblankies: It was resulting from an infinite loop.
@gravitowl
@gravitowl 4 года назад
/schedule doesnt really seem to work, its weird but it doesnt execute the commands...
@Cl0udWolf
@Cl0udWolf 4 года назад
gravitowl it does just it plays at the world spawn and @s won’t do anything. I have a tutorial on it
@gravitowl
@gravitowl 4 года назад
@@Cl0udWolf oh ok
@wilebgingy669
@wilebgingy669 4 года назад
How to optimize loot tables for score based loot replacement
@Cl0udWolf
@Cl0udWolf 4 года назад
WileBGingy scoreboard checks with execute and loot are not that different with performance
@thesuperemeraldboat6194
@thesuperemeraldboat6194 2 года назад
Why not use markers instead of area of affect clouds
@kzkaa.
@kzkaa. Год назад
This video is made before markers are added
@bredcataw
@bredcataw 11 месяцев назад
Also with selectors i use this lines in tick.mcfunction: execute as @a at @s run function test:as2a execute as @e[type=!player] at @s run function test:as2e In as2a you run commands as players In as2e you run commands as entities So you dont must to do in tick: As @a[tag=1] run function 1 As @a[tag=2] run function 2 As @a[tag=3] run function 3 Etc... You just use if entity @s[...] run ... in all this files) CloudWolf, is this good?
@Cl0udWolf
@Cl0udWolf 11 месяцев назад
If you are using similar selectors multiple times it will be better to sub function it, but for a case like this the difference isn’t much. If you can filter before the sub function you will get better performance too. Like @e[type=marker] then @s[tag=1,2,3
@bredcataw
@bredcataw 11 месяцев назад
@@Cl0udWolf @e[type=#tmp:in_use,tag=tmp-in_use] run function tmp:as2e I just want to ask, is it difference with: execute as @e[tag=1] at @s run say 1 execute as @e[tag=2] at @s run say 2 execute as @e[tag=3] at @s run say 3 ... Or: execute if entity @s[tag=1] run say 1 execute if entity @s[tag=2] run say 2 execute if entity @s[tag=3] run say 3 ... What better to use, or what better way to do this?
@Cl0udWolf
@Cl0udWolf 11 месяцев назад
@@bredcataw ofc second one is better because u use less @e
@bredcataw
@bredcataw 11 месяцев назад
@@Cl0udWolf Okey, got ya. Thanks for responding :)
@isaacrobinson683
@isaacrobinson683 3 года назад
whats your outro? its fire
@Cl0udWolf
@Cl0udWolf 3 года назад
Isaac Robinson ? The song is werq by Kevin mcleod
@moonmoonis87
@moonmoonis87 4 года назад
How do I create a permanent invisible AEC?
@Cl0udWolf
@Cl0udWolf 4 года назад
/summon minecraft:area_effect_cloud ~ ~ ~ {Age:-2147483648,Duration:-1,WaitTime:-2147483648} this will last for like 27 years
@Beetless
@Beetless 4 года назад
Thanks
@sonicrushXII
@sonicrushXII 2 года назад
Well I've been using this thing for a while. And I wanted to ask if it was a good idea or not. I run a scoreboard on a fake player that goes from 1-20 Then I run any command(that i don't need to be instantly checked) if it matches 1. Then for my next command i check if it matches 2 Then for my next command I check if it matches 3 and so on... Until I reach 20 (I use way more than 20 commands so it cycles over a few times) This way, the work done per tick is not super intensive. Each task done is different per tick every 20 ticks pretty much what is done in this video ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Jrps_3_dufQ.html
@fuzzyL16
@fuzzyL16 3 года назад
Mhhhh.... welll let’s just restart....
@derpderp4603
@derpderp4603 3 года назад
Spooky 666 likes
@si6585
@si6585 4 года назад
1st and 4th
@FADEDElement
@FADEDElement 4 года назад
third
@si6585
@si6585 4 года назад
Totally first.
@wichtelchen
@wichtelchen 4 года назад
My opinion: That "programming language" of DataPacks is terrible and unnecessarily chews up lot of performance by its nature. You have to constantly hack the system to get more than a "another 10 useless crafting recipes"-pack out of it. - The execute command, which is some kind of a for loop expensively iterating through the entity array most of time, checking each entity against a given condition. - No proper if...else command (you have to abuse the execute command for that, probably two times if you need an else branch) - No { and no }. The only way to have blocks with multiple comands is cramming them into another mcfunction file (which leads to lots of them with more or less unnameable subroutines) - No feasible way to have function parameters, making Interacting between two different entities sometimes is a nightmare. - No proper variables. You have to run execute again and again or abuse the scoreboard or the nbt data for that. - The code becomes unreadable quickly. Using brainfuck is easier. I prefer the good old redstone way over this whereever possible. Mojang, please add at least these features, even the first computers had at least these: if/else, goto/gosub, variables and block statements ({} or python-like indentation)... and please: custom nbt for the crafting result and a way to add custom blocks without sacrificing existing blocks or abusing amor stands and mobspawners (which increases the entity array where the execute command frequently queries from).
@Cl0udWolf
@Cl0udWolf 4 года назад
dont have the time to go through everything but u can easily do if/else and it doesnt need to exist u sound like ur trying to do programming in minecraft commands which is the wrong state of mind. its like trying to do C programming in Verilog. Totally different systems not the same thing. As for variables fake players on scoreboards are int variables and strings are handled with storage and nbt. Its not perfect but its very powerful if u know what ur doing and not just observing from a perspective of C/Java programming
Далее
/attribute Command Tutorial [Minecraft 1.16+]
4:57
Просмотров 109 тыс.
Command Efficiency Tier List
23:40
Просмотров 9 тыс.
Yeni Özbək Mahnisi Yoxsa Vefali Reqsi? 😍
00:36
Просмотров 2,3 млн
Lasagna Soup @Lionfield
00:35
Просмотров 7 млн
I made a Cinematic Camera Datapack for Minecraft!
12:34
I Fixed PARKOUR in Minecraft
8:16
Просмотров 551 тыс.
Easy Pathfinding Datapack [Map-Maker's Toolbox]
10:54
How to Optimize A Datapack!
5:17
Просмотров 1 тыс.
The Quest for Minecrafts Any% Impenetrable Base
20:48
Просмотров 580 тыс.
AI Learns to steal
17:23
Просмотров 334 тыс.
I Made Minesweeper with just Redstone!
17:39
Просмотров 214 тыс.
Macro Selectors in Minecraft [Snapshot 23w33a]
9:16
Playing Minecraft with ChatGPT | Mindcraft
18:34
Просмотров 127 тыс.
Сумерки сасага🧛
11:41
Просмотров 1,2 млн