I should mention that you could make the last example much shorter by just using the size parameter in combination with relative coordinates like: $execute positioned 125 66 111 run fill ~ ~ ~ ~$(size) ~$(size) ~$(size) That would make the scores pretty much obsolete, but then again, I think the example I showed was good to give you an impression of how you could use these parameters for calculations ^^
Super helpful tutorial. I really liked the way you progressed through the explanation. It did take me a while to get the connection between the storage and macro parameters, but overall really helpful. Thanks!
This video is exactly what I need! I have a question: can you directly integrate the scoredboeard into a function? I wrote like this, but it does't work: "/function camp:player1/teleport_player_after_death {X:{"score":"PlayerX"}, Y:{"score":"PlayerY", Z:{"score":"PlayerZ"}}}"
Thanks! When I made the last tutorial, I actually planned to make a whole series about datapack basics. However I quickly noticed that it was kinda a boring job to talk about scoreboards or basic execute commands, so Ill likely only do tutorials whenever I think the topic might be interesting
I see your mcfunction file recognizes the new macros in visual studio. What plugin did you use? The current ones are outdated. I'm making a big datapack using macros and having an error every time is so annoying.
The reason we replace the full area with air once is because we could shrink it from say a 5x5 cube to a 3x3. The new cube is smaller so we have to subtract a bunch of blocks. If the cube wouldnt have the scale feature, then yes you could use replace, but it would be unnecessary and require the block that has to be replaced too
Amazing tutorial but I have only 1 question. How can I get a data value from a NEARBY entity and paste it into a macro command as of 1.21.3? EX: Say there is an armor stand with a score value of say 5, how can I paste it executing as a nearby player into BOTH OF these selectors? $execute as @s if entity @n[type=armor_stand,distance=..3,scores={test=$(score)}] run damage @s 5 player_attack by @p[scores={test=$(score}]
Create a storage for it and use it like that: /execute store result data storage tutorial:path score int 1 run scoreboard players get @n[type=armor_stand] score /function tutorial:macro with tutorial:path
@@Craiy I've been trying to think about that. If you plan on adding shrines, he could point you in the direction of the nearest one. Otherwise, you could buy music related blocks and items from him.
I can't seem to pass a compound during `execute if` in 1.20.4... :( For example: /execute if function tz:xpeffects/eff/str_test {amplifier:1} run say Success! str_test is only: $return run effect give @p minecraft:strength 15 $(amplifier) Doing this still works entirely as exected though: /function tz:xpeffects/eff/str_test {amplifier: 3}
Ok... I got something that works... ## Perform some checks above this line, like checking if we have required inventory or levels data remove storage tz:xpeffects BuffSuccess execute store success storage tz:xpeffects BuffSuccess int 1 run function tz:xpeffects/eff/str_test {amplifier:1} execute if data storage tz:xpeffects {BuffSuccess:0} run function tz:xpeffects/err/stronger_effect_active execute if data storage tz:xpeffects {BuffSuccess:0} run return fail ## Do more stuff now that we have completed all the checks AND applied the buff, like remove required items and levels
Nice video! Honestly, I never use it... The data storage case you just show is pretty much the only interesting thing we can do with it, but you can skip it 99% of the time sadly :/ I see the potential of this first real "variable", but it is not usable by public player trhough a /trigger or anything else, meaning this is mainly a dev tool. Cool, but incomplete, way to rare usecases.
Yeah it does make a lot of things shorter when you use it right, but I agree the way it currently is, I don't use it as much as I thought I would. If you think outside the box tho, there are a couple of new things that weren't previously possible, like the last example I showed
I should mention that you could make the last example much shorter by just using the size parameter in combination with relative coordinates like:
$execute positioned 125 66 111 run fill ~ ~ ~ ~$(size) ~$(size) ~$(size)
That would make the scores pretty much obsolete, but then again, I think the example I showed was good to give you an impression of how you could use these parameters for calculations ^^
this seems super useful, but I’m gonna have to watch this video like 30 times to actually get it lol
4:10 Is tutorial:cube another function and what do I have to written down in it? Thanks!
Lol I havent noticed that until now. Apparently I have renamed the function to fill_cube_macro which I show directly after. Sorry for the confusion
Super helpful tutorial. I really liked the way you progressed through the explanation. It did take me a while to get the connection between the storage and macro parameters, but overall really helpful. Thanks!
Yeah there isnt really a connection. We just write data in the storage and can use it to call a function later on
no way bro why are you this small you are soo underrated
Thank You so much for this tutorial! yesterday I spent hours failing to use them but today I finished what I was trying to do in just 5 minutes!
Technically, they added variables, which weren't a thing for decades
Yup and its insane. Everything will change now. You can store an entire command in a macro and run it
This video is exactly what I need! I have a question: can you directly integrate the scoredboeard into a function? I wrote like this, but it does't work:
"/function camp:player1/teleport_player_after_death {X:{"score":"PlayerX"}, Y:{"score":"PlayerY", Z:{"score":"PlayerZ"}}}"
I wish 😭
Wow this is such a cool command! I can't even begin to imagine how much simpler data pack code is going to become because of this!
Yup it changes everything! Btw good to see you m8 ❤
ANY COMMAND IS NOW DYNAMIC THATS SO USEFULL
This is super useful, thank you!
You can update a endermorph .for doge and new power and new enderman or new boss
Macro command r so useful as it allows everything to be dynamic
We need more videos like this from you
Thanks! When I made the last tutorial, I actually planned to make a whole series about datapack basics. However I quickly noticed that it was kinda a boring job to talk about scoreboards or basic execute commands, so Ill likely only do tutorials whenever I think the topic might be interesting
You explained it in a way that everyone can understand. You are great!
Thank you! Thats really nice to hear as that was my goal with this video :)
Can you make a telekinesis power datapack ?
I kinda did already. Have a look at my enderman datapack (or maybe even the gravity gun)
th-cam.com/video/tkFkxh87-WA/w-d-xo.html
@@Craiyok thanks
@@CraiyBut if you can, make a datapack that gives us elemental powers
@@eyes_of_devil There you go :D
th-cam.com/video/K-4jZXadzIc/w-d-xo.html
I see your mcfunction file recognizes the new macros in visual studio. What plugin did you use? The current ones are outdated. I'm making a big datapack using macros and having an error every time is so annoying.
It doesnt recognize them, I just disabled error checking for this tutorial
Very well explained, even I was able to understand! 😅 Great video 👍
Thanks! :)
cant you add replace at the end of the fill command to not have to clear it first?
The reason we replace the full area with air once is because we could shrink it from say a 5x5 cube to a 3x3. The new cube is smaller so we have to subtract a bunch of blocks.
If the cube wouldnt have the scale feature, then yes you could use replace, but it would be unnecessary and require the block that has to be replaced too
Amazing tutorial but I have only 1 question. How can I get a data value from a NEARBY entity and paste it into a macro command as of 1.21.3?
EX: Say there is an armor stand with a score value of say 5, how can I paste it executing as a nearby player into BOTH OF these selectors?
$execute as @s if entity @n[type=armor_stand,distance=..3,scores={test=$(score)}] run damage @s 5 player_attack by @p[scores={test=$(score}]
Create a storage for it and use it like that:
/execute store result data storage tutorial:path score int 1 run scoreboard players get @n[type=armor_stand] score
/function tutorial:macro with tutorial:path
@@Craiy tysm!!!
In your botw data pack, are you planning on adding Kass at any point?
Hmm actually not planned yet. I mean what would kass do?
@@Craiy I've been trying to think about that. If you plan on adding shrines, he could point you in the direction of the nearest one. Otherwise, you could buy music related blocks and items from him.
Yea, one of the best command system update ever.
Can you pls make the portal gun and the gravity gun datapacks for the 1.20.1 version?
Did you try it? Because I didnt for quite some time, but I think those should work at 1.20.1
@@Craiy no i doesnt try it,
Thank you
very helpful video
I can't seem to pass a compound during `execute if` in 1.20.4... :(
For example:
/execute if function tz:xpeffects/eff/str_test {amplifier:1} run say Success!
str_test is only:
$return run effect give @p minecraft:strength 15 $(amplifier)
Doing this still works entirely as exected though:
/function tz:xpeffects/eff/str_test {amplifier: 3}
Ok... I got something that works...
## Perform some checks above this line, like checking if we have required inventory or levels
data remove storage tz:xpeffects BuffSuccess
execute store success storage tz:xpeffects BuffSuccess int 1 run function tz:xpeffects/eff/str_test {amplifier:1}
execute if data storage tz:xpeffects {BuffSuccess:0} run function tz:xpeffects/err/stronger_effect_active
execute if data storage tz:xpeffects {BuffSuccess:0} run return fail
## Do more stuff now that we have completed all the checks AND applied the buff, like remove required items and levels
what editor are you using?
Vscode
@@Craiy how did you get the language support for the datapack language. Mine doesnt seem to work with the new macros
@@ludev5743 Yeh I disabled error checking for this tutorial
@@Craiy k, thanks man!
is there a way i can make it run every frame?
Sadly only works on a tick basis, so 20 times a second. You can't really get higher than that
Easy looping through arrays goes brrrr
Nice video!
Honestly, I never use it... The data storage case you just show is pretty much the only interesting thing we can do with it, but you can skip it 99% of the time sadly :/
I see the potential of this first real "variable", but it is not usable by public player trhough a /trigger or anything else, meaning this is mainly a dev tool.
Cool, but incomplete, way to rare usecases.
Yeah it does make a lot of things shorter when you use it right, but I agree the way it currently is, I don't use it as much as I thought I would.
If you think outside the box tho, there are a couple of new things that weren't previously possible, like the last example I showed
@@Craiy hum... possibly interessting usecases with the /return... got to work on this ^^
Informatik Student😂
?
@@Craiy du kennst dich da aus. Deswegen der Witz
now we only have to wait until we have normal number operations...
Imagine multiplying in less than 3 lines 😱
As soon as I typ "$" in my tp_macro.mcfunction file in visual studio code it shows me an underlined red line. DO you know why? @CRAIY
Yes, update your mcfunction addons. This is a new thing so its not recognized by every addon/old versions
Hey, I told you before that you explained it very well, can you also explain how to raycast?
cool