• 0

    posted a message on book password redstone system (need updated version)
    Quote from Megacrafter107»

    /clear @p minecraft:writable_book{pages:["openthegate"]}


    ok, I see the difference.

    Thank you very much Megacrafter107. Your help was precious for me. Cheers!

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on book password redstone system (need updated version)
    Quote from Megacrafter107»

    This should work:

    clear @p minecraft:written_book{pages:["{\"text\":\"openthegate\"}"]}


    text in 1.13+ is JSON formatted. Before, you would use § + color codes to get colored text. Now you can do this with JSON


    Your system can be compacted into just 2 blocks if you change the impulse one to a repeating always active command block and change the second one to a chain, conditional and always active command block. If you want to have more outputs, you can leave it like this as you won't be able to use the comparator on a repeating command block¸or you can add a third command block with a /setblock command to activate more circuits.


    I see that the book has to be signed to make this work.
    Is that a condition or is there a way I just need to write the password in the book without signing it?

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on setblock chest with written book (syntax problem, 1.14.4)
    Quote from Megacrafter107»

    /testfor and /testforblock is now a part of /execute and is used like this:

    /execute if block -81 75 132 emerald_block run setblock -76 75 135 redstone_block


    also, you can set the impulse command block to repeating and always active to eliminate the clock since your chain command block is already conditional


    Oh, it is more simple than I thought. That's good!
    Thank you for your answer. I really appreciate!

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on book password redstone system (need updated version)

    Hi, I was using this incredible and efficient system in Minecraft 1.12, but it does not work anymore.


    The thing is to take a blank book and write the appropriate password in it and by doing that, it activates a redstone circuit (opens a door or anything else). Here what it looks like:


    The clock activates the command block: /clear @p minecraft:writable_book 0 0 {pages:["openthegate"]}


    So, when I write "openthegate" in a blank book, the door opens (in this example. But it can activates any other redstone circuit).

    A lot of this system is used in my project and it is broken since the update of the commands. I really need this to work.
    I did not invent this brilliant system. I found it in a youtube video from "drackiseries";
    Here is the link to it:



    I don't know why it doesn't work anymore. Any help is appreciate. Thanks!

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on setblock chest with written book (syntax problem, 1.14.4)

    1. Hi, my first command is:

    I want to place a specific block at a specific coordinates. When it is placed, it activates another command (a setblock command).

    It worked in 1.12 with the "testforblock" command. But now (in Minecraft 1.13+), I don't know how to make it work with the execute/detect commands.I see that it works with entities, but how to detect a solid block?

    Here is the configuration:
    A clock is linked to the command blocks. The first command block is: testforblock -81 75 132 emerald_block (impulse, unconditional, needs redstone).
    (-81 75 132 are the coordinates just above the emerald ore block. This is where I want to place an emerald block to trigger the other command block).



    The second command is: setblock -76 75 135 redstone_block (chain, conditional, needs redstone).
    When the emerald block is placed, it turns the lapis block into a redstone block and light up the lamp.


    This is only an example of what I wish to do. When a specific block is placed at a specific coordinates, it triggers another system.

    Any help with this would be much appreciate. Thank you!

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on setblock chest with written book (syntax problem, 1.14.4)
    Quote from Megacrafter107»

    Just post the commands you need help with in this thread or a new one and I'm sure I or someone else will reply


    Alright thank you. I go to work and I'll post my command afterwards.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on setblock chest with written book (syntax problem, 1.14.4)
    Quote from Megacrafter107»

    when using the /give command, anything you write inside the curly brackets is automatically placed inside the items tag. Example:

    /give @s stick{display:{Name:"\"this is a stick\""}}


    the stick will have the following data:

    tag:{display:{Name:"this is a stick"}}


    When you have to apply data to an item inside a large command like this, you don't use the curly brackets but instead, you write the full path like shown above.


    So your command should look like this:

    setblock ~ ~1 ~ minecraft:chest{Items:[{Slot:0b,id:"minecraft:written_book",Count:1,tag:{pages:["{\"text\":\"\\u201cYou keep it, but it never ages. Once shared it is gone forever.\\u201d\"}"],title:Riddle,author:"Dungeon Master"}}]}


    Thank you very much for helping me. It works fine.

    I think I understand the purpose, but I'm not sure if I can reproduce this to another large command.

    I mean, I'm so confused with the brackets and the quotation marks.
    And English is my second language. I'm ok, but in matter of syntax, I'm quite lost.

    I have several commands to transfer from 1.12 to 1.13 (or version above) and I'm having a hard time to succeed at it.

    Two principal ones are important for my project to be transfer (block detection and book n' quill password).

    They worked in 1.12 but not after.


    Are you willing to help me on those two?

    I can give you more details if you want.

    Regards

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on setblock chest with written book (syntax problem, 1.14.4)

    Hi, I want to insert a command into a command block that will create a chest with a custom written book in it.

    I have some problem with the syntax. Here is what I got yet:


    1. I can set a chest with a written book (this works):


    /setblock -146 75 262 chest[facing=north]{Items:[{Slot:0,id:written_book,Count:1}]} replace


    2. I can give a written book with the custom text (this works):


    /give @p written_book{pages:["{\"text\":\"\\u201cYou keep it, but it never ages. Once shared it is gone forever.\\u201d\"}"],title:Riddle,author:"Dungeon Master"}


    3. I cannot merge both. I tried this way:


    /setblock -146 75 262 chest[facing=north]{Items:[{Slot:0,id:written_book{pages:["{\"text\":\"\\u201cYou keep it, but it never ages. Once shared it is gone forever.\\u201d\"}"],title:Riddle,author:"Dungeon Master"},Count:1}]} replace


    I'm confused with the syntax (symbols and orders). Any help would be very appreciated. Thank you!

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on execute a command when player walks on a specific cordinates
    Quote from s_leroux»


    🎓

    Indeed! At the risk of sounding pedantic , in CS we say such operation is idempotent: "[it] can be applied multiple times without changing the result beyond the initial application"






    More seriously, I assume your goal was to trigger other command blocks execution with that redstone block. Could you tell me a little bit more about that or share a screenshot of such design? As I said previously, I'm new to all of this, and I would be curious to see how we can handle control structures or alternate branches of execution with Minecraft commands and command block chains.



    Hmmm, actually, I have a lot of mechanisms that I want to produce in my project.
    But I'm not there yet, so it is difficult to demonstrate.

    Here is my situation:
    I'm building a huge adventure map in a previous version of Minecraft (1.2.5).
    This is the version that I like... to terraform and do all the buildings of all areas involved.
    Because I have my mods (worldedit, singleplayer commands and all my keyboard shortcuts) already installed like a portable application.
    Once done, I will add all new blocks and items involved and the command block systems into my project.

    ----

    All the mechanisms that I want to place are tested in a test map in the current minecraft version (first, i was playing 1.12 and now I am at 1.14.4)
    I have a lot of them.

    For example, with the detection command:

    the player walks on a specific coordinate and it triggers the redstone block (as mentioned above).
    This one activates a fill clock linked to another coordinate.
    This next coordinate teleports the player to another place in the map (far away... like it is another map or world).
    I can also link the redstone block to other clocks that control the time, the weather, the spawn point, the effects, or else.
    It can also be linked to a locked gate (door) somewhere else. So the player needs to walk there to be able to go somewhere else.

    I have a lot of them that can be linked together depending of my storyline.
    I'm trying to combine my knowledge of mechanisms to create more complex systems that are coherent with my story.

    ----

    To conclude, I cannot really answer your question accurately for now and I am sorry about it.
    I'm trying to finish my buildings and then I will be more in the mechanism phase of my project. Then, I could demonstrate my stuff.


    I had noticed earlier this week that one of the detection command (like the one shown on this thread) was no more functioning.
    I wanted to correct this now, but I'm sure I will have plenty of other commands to re-adjust in the near future of my project.
    **Hopefully, minecraft will be stable in the way of the syntax of the commands. I mean, I'm tired of all the changes when a new minecraft version is out! (ex: target selector distance instead of radius. But I know it is for a better use and it might be more efficient. Sincerely, I'm really not good in commands and programming languages. I have red and viewed a lot of tutorials. And now, I'm depending on my test map to make it succeed. I will need further help to make the whole thing work** :D

    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on execute a command when player walks on a specific cordinates
    Quote from s_leroux»

    Thank you for having posted the solution!

    Amusingly enough, I was bitten myself by the `as`/`at` clause of the execute command yesterday. And despite that, I didn't pinpoint a similar issue in your command. I definitively need a lot more practice with Minecraft commands!

    Actually, in your case, I suspect the following commands would do the trick too:

    execute as @a[x=-160,y=75,z=164,distance=..1] run setblock -153 75 165 redstone_block
    execute if entity @a[x=-160,y=75,z=164,distance=..1] run setblock -153 75 165 redstone_block



    According to my (very recent) knowledge in that matter, I would favor the `if entity` version: I think the `as`/`at` versions may be less efficient, since they may potentially run the `setblock` command several times, once for each matching entity. Or am I wrong?


    I don't know about this.
    But in my case, it doesn't matter, since my setblock command sets a redstone block that triggers a fill clock to another system.
    I will keep that in mind though for other uses. Thanks for sharing this!

    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on execute a command when player walks on a specific cordinates

    Ouf!!!


    The previous command that wasn't functioning was:

    execute @a[x=-160,y=75,z=164,distance=..1] ~ ~ ~ run setblock -153 75 165 redstone_block



    I just find out the correct syntax for this command. Here it is:


    execute at @a[x=-160,y=75,z=164,distance=..1] run setblock -153 75 165 redstone_block


    The "at" was important due to executing the command at all players that are positioned on the coordinates (-160 75 164).

    And also, I removed the ~ ~ ~ position after the target selector and it worked!


    Hopefully, the syntax will remain the same in next minecraft versions... All those changes are troubling my commands!

    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on execute a command when player walks on a specific cordinates
    Quote from s_leroux»

    I'm not at all sure this is the only issue, but the keyword `run` in missing in your command:


    execute @a[x=-160,y=75,z=164,distance=..1] ~ ~ ~ run setblock -153 75 165 redstone_block
                                                     ^^^


    Thanks for your reply. I have also tried this way (with the "run" as you shown), but it is not working.

    There's something else, but I don't know.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on execute a command when player walks on a specific cordinates

    Hi! I used to play Minecraft version 1.12. But since I upgraded to 1.14, several commands are not functioning anymore.
    Here is the specific one that I wish to make it work:


    I simply need a redstone block to be set when the player walks on a specific coordinates.
    It uses to work very well in 1.12 with this syntax:

    execute @a[x=-160,y=75,z=164,r=1] ~ ~ ~ setblock -153 75 165 redstone_block


    It doesn't work in 1.14. I tried this way, but without success:

    execute @a[x=-160,y=75,z=164,distance=..1] ~ ~ ~ setblock -153 75 165 redstone_block


    What is wrong with my command? Thanks for all help.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Detect a specific unstackable item/weapon
    Quote from drhubs»

    /kill @e[type=minecraft:item,x=11,y=71,z=110,distance=..2,nbt={Item:{tag:{display:{Name:"{\"text\":\"Blade\"}"}}}}] run setblock 9 74 111 minecraft:redstone_block


    To kill the item. Im not sure how two swords will work. I tried using count=2 but idk if that works. I think you might have to create a mini scoreboard. Tally up how many swords are alive, then execute and activate if scores = 2


    ok, thank you for all this!

    Posted in: Redstone, Commands and Mechanisms
  • 0

    posted a message on Detect a specific unstackable item/weapon

    It works like a charm.


    Can you tell me what command should work to kill the items thrown nearby?
    And what command if it needs to detect 2 items with the same custom name to activate the redstone?


    Thanks

    Posted in: Redstone, Commands and Mechanisms
  • To post a comment, please or register a new account.