If-Else Statements in Minecraft Datapacks

Поделиться
HTML-код
  • Опубликовано: 3 янв 2025

Комментарии •

  • @conure512
    @conure512 6 месяцев назад +88

    This is the #1 reason I was so hyped when they added "/return run" lol, great to see you covering it :)

  • @dragendghast
    @dragendghast 6 месяцев назад +9

    This is awesome dude!
    As someone who is just getting into making datapacks after they changed up components and other stuff recently, it's been super valuable to have people I can watch and learn from.

  • @Pikatscha
    @Pikatscha 6 месяцев назад +13

    Very usefull indeed. Thanks for showing! Love how I could redo everything in my project like every few months, cause of new versions and learning of such features lol

  • @Voriaxly
    @Voriaxly 6 месяцев назад +12

    Needed this so bad. Absolute Godsend

  • @SparkKnight556
    @SparkKnight556 6 месяцев назад +8

    This is awesome! Can't wait to figure out all the uses for this!

    • @Cl0udWolf
      @Cl0udWolf  6 месяцев назад +8

      if i ever get around to a new ui tutorial i will for sure use it there

  • @sodalish
    @sodalish 6 месяцев назад +2

    Long time fan just wanted to say thanks for keep coming back to share these nuggets. Best

  • @godofgrains
    @godofgrains 6 месяцев назад +5

    hell yeah a conure and cloud wolf upload on the same day

  • @BD0G
    @BD0G 6 месяцев назад +2

    finally. so many use cases for this. I would be interested in the UI tutorial!

  • @Kepplar
    @Kepplar 6 месяцев назад +1

    Goodness me I am excited. I remember searching up desperately looking for this function and was disappointed.
    Glad it's here!

  • @vectorminecraft
    @vectorminecraft 6 месяцев назад

    I love your tutorials. I haven't coded in minecraft since they added datapacks but your videos make me want to get back into it lol.

  • @SuperAngel2384
    @SuperAngel2384 6 месяцев назад

    I can't believe you still work with Minecraft commands after over 8 years, I watched DanTDM play "A Weekend in Hartsville" and "Quantum Labs" and those were some of my favorite maps I've ever watched him play. Keep doing what you do best! :D

  • @spoonofsugar1431
    @spoonofsugar1431 6 месяцев назад

    I remember you from my favorite map when i was like 11, a weekend in heartsville! thanks for being apart of my childhood!

  • @AwesomeDomi1
    @AwesomeDomi1 6 месяцев назад +2

    Seeing what you can do with datapacks as they add more commands is so nice, now I wish they would add more freedom in the entity selector, like if I want to select @e[type=cow or type=sheep] to select both cows and sheep

    • @coledoe1030
      @coledoe1030 6 месяцев назад +2

      You can do this with custom entity tags

    • @vat1n456
      @vat1n456 6 месяцев назад

      /tag @e remove OurTag
      /tag @e[type=cow] add OurTag
      /tag @e[type=sheep] add OurTag
      --> @e[tag=OurTag]

    • @AwesomeDomi1
      @AwesomeDomi1 6 месяцев назад

      @@vat1n456 yes I’m aware, but that still takes 4 commands, it would be nice to be able to do it in 1, not to mention if you want more different entities you need even more

    • @vat1n456
      @vat1n456 6 месяцев назад

      @@AwesomeDomi1 I agree. The selectors are pretty restrictive since they don't always support the 'OR'. It should be nice to see new concepts like sets of arguments in order to let the game choose between the type A or B. For example, /execute if entity @e[type=(minecraft:cow,minecraft:sheep)]. Unluckily, it's not here yet
      Otherwise, I think there is a workaround in one line. I don't know if it's satisfying, but :
      /execute unless entity @e[type=!cow] unless entity @e[type=!sheep]
      Explanation :
      Let A and B be the statements A="this is a cow" and B="this is a sheep". It's known that the expression "A or B" (our main goal) is equivalent to "not A and not B" (which explains the appearance of "unless" keyword and the "!" inside selectors)

  • @CreativelyJake
    @CreativelyJake 6 месяцев назад

    getting into datapacking, and seeing examples of stuff like /return is really helpful, ty!!
    like. my functions are a bit messy... but im learnin what return does, and what execute store does...

  • @mnight-4
    @mnight-4 5 месяцев назад

    OH MY LORD, I REALLY NEED IT.
    THABKS!!!

  • @TZARpixelforge
    @TZARpixelforge 3 месяца назад

    IDEA: Rideable Giant Wolf 🐺 Mount with a boss fight?

  • @tonylovesmusic
    @tonylovesmusic 6 месяцев назад

    this saved me hours of frustrations 😅

  • @newkamil3757
    @newkamil3757 6 месяцев назад +2

    How do you use the visual studio code extension without it flagging everything as red????

  • @WesleySprayue
    @WesleySprayue 5 месяцев назад

    Hey thanks for this! I can make a card game in minecraft using this!

  • @TheKnytemayor
    @TheKnytemayor 5 месяцев назад

    Thanks, this helped a lot, but how would you check for the value of one variable, not as two separate booleans? For example, X could be 0, 1 or 2. (i’m trying to make a random decision function)

  • @HarisRehmanGG
    @HarisRehmanGG 5 месяцев назад

    Summary:
    #IF
    execute (condition) run return (answer)
    #ELSE
    (another)
    condition is like using if or something else like predicates idk
    answer is like a command or function, anything
    another is the other bits in your file, this can be a IF statement also

    • @HarisRehmanGG
      @HarisRehmanGG 5 месяцев назад

      btw tysm for telling this 😁 very useful indeed

  • @GoldenRJL123
    @GoldenRJL123 6 месяцев назад +1

    yes plzzz new UI I have been stuggeling to update your old UI to 1.21 also I was able to change the ender chest stone button on head to a light gray stained glass pane inside the new crafting.slot.0 and everytime someone opens there inventoty and closes it or throws it out it copys it back to the crafting slot, but I am struggeling whith air{drop_contents:1b} cuz whith the new components that nolonger works

  • @BeezyMC
    @BeezyMC 6 месяцев назад

    I love this!

  • @mc_acmora8554
    @mc_acmora8554 6 месяцев назад

    i have a question, which extensions por VS Code did you use for datapacks creation. I used one, but with the 1.20.5 update, it is not compatible.

  • @kaitouaonhayy
    @kaitouaonhayy 6 месяцев назад +1

    can i ask for 1 question? what extension you use in visual code

    • @Cl0udWolf
      @Cl0udWolf  6 месяцев назад

      Read other ppl’s comments

  • @mika34653
    @mika34653 6 месяцев назад +5

    NO WAYYYYYYYYYYYYY

    • @mika34653
      @mika34653 6 месяцев назад +2

      oh lol i've been using that already im stupid hahah

  • @V1c._.
    @V1c._. 6 месяцев назад

    Can we do math with data packs now? I dunno what’s new

  • @maxanimator9547
    @maxanimator9547 6 месяцев назад

    return in an execute statement breaks the flow of the script ; is this neat behaviour common to the return command as well, more than the return subcommand of /execute ?

  • @bifusmorgus9000
    @bifusmorgus9000 6 месяцев назад +2

    this is huge

  • @gloxost
    @gloxost 6 месяцев назад

    So if i am not mistaken this is just execute unless but 10 times better right?

  • @terrywilliams450
    @terrywilliams450 6 месяцев назад

    What VS Code plugin do you use for datapacks?

  • @SupFederich
    @SupFederich 6 месяцев назад

    Strange how i had a lot of programmed stuff and datapacks that when they got updated to 1.21 stopped to work

    • @Cl0udWolf
      @Cl0udWolf  6 месяцев назад

      All plural names folders were renamed to singular expect a few

  • @M_1024
    @M_1024 6 месяцев назад +1

    What extension to vs code do you use?

    • @Cl0udWolf
      @Cl0udWolf  6 месяцев назад +1

      datapack helper and datapack icons, but its just for videos i dont actually use those

    • @mc_acmora8554
      @mc_acmora8554 6 месяцев назад

      Does they work for 1.21 data pack(? Because for 1.21 datapacks it doesn't work ​@@Cl0udWolf

  • @_bertrd5294
    @_bertrd5294 6 месяцев назад

    I'm curious. How would you go about making a switch case statement ?

    • @Cl0udWolf
      @Cl0udWolf  6 месяцев назад +1

      i would just use a giant if-elif block like this running a function for each case. not a more effecient way

  • @coledoe1030
    @coledoe1030 6 месяцев назад

    Ok so if I understand properly, the “run return” end but just like ends the function and does something else?

    • @Run2Seeun
      @Run2Seeun 6 месяцев назад +1

      When return passes, the rest of the function is skipped. You can either run something along with it or use return fail to skip without doing anything

  • @MonkeyAntagonist
    @MonkeyAntagonist 6 месяцев назад

    so if the return command is unsuccessful it will allow the following commands to run as normal but if it runs successfully it will stop the function early?

    • @Cl0udWolf
      @Cl0udWolf  6 месяцев назад

      If you run return it kills the current function. So if you have conditional stuff before running the return command and that conditional stuff fails, of course the command will not run

  • @MarvelousButter
    @MarvelousButter 6 месяцев назад

    Is there any program to autoupdate item nbts to components out there?

    • @Cl0udWolf
      @Cl0udWolf  6 месяцев назад +1

      there might be some, misode's generator can do it but you need to paste each thing in one at a time.

  • @psyonide1394
    @psyonide1394 6 месяцев назад

    Was return then run always in commands?

    • @Cl0udWolf
      @Cl0udWolf  6 месяцев назад +1

      been there for a while, maybe 1.18

    • @vat1n456
      @vat1n456 6 месяцев назад

      It was added in 1.20.2

  • @HMT_main
    @HMT_main 6 месяцев назад +2

    Didn‘t you use sublime text?

  • @danijelkonc4168
    @danijelkonc4168 6 месяцев назад

    Comment for the algorithm! #FixTF2