Minecraft 1.12

Discussion in 'General Minecraft Discussion' started by Unoski, Feb 8, 2017.

  1. Yay! It's not a snapshot anymore! :D
  2. So we're well into 1.12 now and honestly, I can't help grin about certain youtubers. Laugh even. Ignorance is bliss I believe is the saying...

    When functions became more known several players linked the functionality of that (=the ability to execute several commands with one /function command) to command blocks. As such some started wondering if functions wouldn't spell the end for command blocks.

    As said, we're well into 1.12 right now and I can't help wonder why only a few people seem to realize the huge potential which advancements are going to give us. Instead some keep whining about those functions :p

    Prediction: advancements are going to become just as important for Minecraft programming (or scripting) as the scoreboard currently is today.

    This may sound like a weird comment to make. After all: aren't those advantages merely a few tasks which you can do after which you get a badge and optionally some XP as reward?

    Sure thing. But aren't you now forgetting that custom advancements are also a thing?

    Example: Say you want to get a mob to drop more XP than normal. In fact: if a player kills a skeleton it should drop 5xp extra. And in vanilla, so no mods or something. That would be nearly impossible because the XP reward system is not something you can customize right now. You can change so called loot tables for a mob but that would only affect the items it dropped.

    Guess what?

    An advancement can be triggered by approx. 28 different things. Amongst which: player_killed_entity. Better yet: you can even specify exactly what kind of entity. Like, say, a skeleton.

    So what would happen if you'd make an advancement which is hidden, won't be announced to chat nor will it show you the 'advancement warning' ('toast'). It gets triggered when a player kills a skeleton and as a reward it'll grant them 5xp and executes a function. The function then revokes this specific advancement from said player again (@s is a thing in functions).

    Long story cut short: it would set it up so that everyone gets an extra 5xp per killed skeleton.

    This is just 1 example. Adventure map, player needs to trade with a villager to continue. How to check if the trade took place? Right now you may be able to check a players inventory. But why not use an advancement? It doesn't only have a trigger to check that a player traded with a villager, you can also check exactly which trade should be done. Use the function for a reward and you're home free. You could tag the player for example (scoreboard players tag @s add traded).

    The potential is so dramatically high you'd risk blowing your mind over this when you think about all the possibilities. From breeding animals, enchanting items, consuming items, changing your location (or dimension), taming animals, hurting entities (mobs), sleeping in beds.... all are valid triggers for an advancement, and all allow you to specify details to check for.

    Sure.. it's not perfect. Right now you can't check if a player used something (like pushed a button), or if you want to check that a player entered the water before placing a block (so placed a block under water). The latter is somewhat doable, but not necessarily globally ("placed a block in any water stream").

    But even so.. the current available options are still enormous.

    .... and almost every Minecraft youtuber, even the so called Minecraft experts, have totally overlooked this so far. Ironically enough even those who, somewhere in the past, ran into some of these issues when messing with command blocks and redstone.

    The advancement system is much bigger and flexible than you may have realized so far :)
    TomvanWijnen, PhoenixAffinity and 607 like this.
  3. Easily adding colored names to your game without MCEdit

    There is a reason I'm dumping this here... This will only attract players interested in 1.12, it will reduce risks of players trying to abuse anvils (you won't succeed anyway, and even if you could then the missing Lore will always give a fake promo away) and yeah...

    Keyword: Functions.

    Now, as you might know the § character is key in adding color to written books. Many popular plugins turned to the & character to specify color codes (even the Empire ;)) but the official character is actually §.

    However, there's a problem: while you can paste it into a book & quill while writing you can't get this easily into the chat interface itself, or a command block for that matter. Minecraft uses the § but it doesn't like it at the same time. But a solution has been found: functions & escape characters.

    In short: an escape character is often used in computing to denote that the next character should be treated literal. For example, say that I want to give my sword this (literal!) name: The "Ultimate" sword! No, not using an anvil but using a /give command. And as of 1.12 using quotes around names with a space in them became mandatory.

    SO.... you think this will work: /give @p diamond_sword 1 0 {display:{Name:"The "Ultimate" Sword"}} ?

    It doesn't :confused: Because the moment Minecraft spots the second " it'll treat that as the end of the name. Fortunately there is a solution: adding an escape character which tells Minecraft to treat the next character literally:

    This is the right command: /give @p diamond_sword 1 0 {display:{Name:"The \"Ultimate\" Sword"}}

    Why I'm telling you all this? Simple....

    Try making a function, and then try using the § character in the name part so that you can add colors and formatting codes. You won't succeed because the very moment Minecraft spots the § it'll refuse to load the function. But here's where things become interesting: add two § characters and the function does load. The name will become gibberish, but it still works. In other words: when escaped then the § character gets to be used in a function.

    So what would happen if you properly escape it?

    I tried a lot already but failed. \ doesn't work, and dozens of other characters don't work(tm). So then I started looking things up on Google and found a solution: Â does work. Alt-0194 on Windows.

    SO... lets make the name bold yellow and italic:

    /give @p diamond_sword 1 0 {display:{Name:"§6§l§oThe \"§fUltimate§6§l§o\" Sword"}}

    Add that into a function (for example: data\functions\mystuff\giveitems.mcfunction), then fire it up: /function mystuff:giveitems. Presto: instant colored names in your world.

    Proof of concept:

    WardleDeBoss, Jelle68 and 607 like this.