• 0

    posted a message on Password System

    You can have the player holding a name tag and check if the name tag has the right name on it.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Why does this command not work?

    It's because you don't understanding the using of "facing"


    Facing means that your command will be played like if it looks at a pig.

    It is necessary if you want to throw a projectile to a pig for exemple, you will have :


    /execute as @e[tag=your_projectile] at @s facing @e[tag=pig] run tp ^ ^ ^1


    Here the command is run by the projectile, at his position and looking at the pig and it tp the projectile 1 block where it looks at, so at the pig.


    If you want to have a command that run when you look at a pig, that's more complicated, you have to create a raycasting function (in a datapack).

    It looks like this :


    execute unless entity @e[distance=...1,type=pig] unless entity @s[distance=..5] positioned ^ ^ ^.1 run function datapack:raycasting 


    and in your tick.mcfunction, you put this :


    execute at @s anchored eyes positioned ^ ^ ^ run function datapack:raycasting 

    I don't know if this is possible with only command block, I doubt it.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on About hunger

    I don't think there is a way instead of the command you mention.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Tick.json only running when the namespace "minecraft"

    Well tick.json is supposed to run only if it is in "functions" folder in a "tags" folder in a "minecraft" folder. And in here you have to tell it where your tick.mcfunction is.


    Your datapack folder has to be like this :

    \ [folder name]
                  pack.mcmeta
                  \ data
                            \ [datapack name ("test" in my exemple)]
                                        \ functions
                                                  tick.mcfunction
                           \ minecraft
                                       \ tags
                                                 \ functions
                                                             tick.json




    So next to your minecraft folder you create a folder name "test" (for exemple), with inside another folder named "functions" and in this functions folder you put your tick.mcfunction.


    Then in your tick.json you have to write


    {
    "values": [
    "test:tick"
    ]
    }
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Summoning entity with a block on their head (1.16)
    /summon zombie ~ ~ ~ {ArmorItems:[{},{},{},{id:"minecraft:bedrock",Count:1b}]}
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Total Distance in Km (or M) scoreboard?

    Here your scoreboard for sneak distance :


    scoreboard objectives add sneak minecraft.crouch_one_cm
    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on Arrow based stopwatch command script?

    Here for you :


    https://mega.nz/file/VZEhhC7D#_RyAtvwbgGV_99677_LkpBlFFdHXwTPmo5yqygMVW_U


    If you want it to just say it with a special bow, add in tick.mcfunction in the first line the nbt you want the player to have :P


    By the way, I killed the arrow when it say how many tick, if you want it to stay, tell me and I will change this.


    Oh and it doesn't work with entity, only block :P

    Posted in: Redstone Discussion and Mechanisms
  • 0

    posted a message on How to clone to entities position

    I don't understand what you want exactly, but I can say that you can add as many at/as as you want.


    For exemple, if you want to execute a command as the armor_stand nearest of you, you can write that :


    /execute at @p as @e[sort=nearest,type=armor_stand]

    you can even write


    /execute at @p at @e[sort=nearest,type=armor_stand]

    if you just want to execute the command on the position of the armor stand nearest to the player.


    I don't know if it will help you, if not, maybe try to be more clear about your situation :)

    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on command dx dy dz problem

    Just replace "if entity @a" by "as @a". In your actual command, nobody is running the command so your game don't know who to pass in survival mode.

    With "as @a", you say that it is the player within your area that will run the command.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Death/Potion effect when standing on a specific block

    just put a command block in repeat unconditional always active mode with this command :


    execute as @a at @s if block ~ ~-1 ~ minecraft:dirt run effect give @s minecraft:poison 1 1


    or if you want to kill :


    execute as @a at @s if block ~ ~-1 ~ minecraft:dirt run kill @s

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Set worldborder by scoreboard

    It's not possible to do it easily. The only way is to make a function that will call another function which increase the world border by 1 as many time as you have score.


    The first function will be like this : (function name : this_function)


    function datapack:increase
    scoreboard players remove #distance 1
    execute if score #distance matches 1.. run function datapack:this_function 

    and the second will simply be : (function name : increase)


    worldborder add 1
    Posted in: Redstone Discussion and Mechanisms
  • 0

    posted a message on Help on making intervals for Rpg conversations texts.

    you don't even have to summon an armor stand if you just use scoreboard, you can use a fake player. With Rocker's commands, you have :


    command block 1: repeating unconditional always active
    
    scoreboard players add #timer timer 1
    
    
    command block 2: repeating unconditional always active
    
    execute if score #timer timer matches 1 run title @a title {"text":"dialog 1","color":"green"}
    
    
    command block 3: repeating unconditional always active
    
    execute if score #timer timer matches 61 run title @a title {"text":"dialog 2","color":"green"}
    
    
    and if you want to reset the timer/start the dialog: /scoreboard players set #timer timer 0
    Posted in: Redstone Discussion and Mechanisms
  • 0

    posted a message on How to add an enchantment on crafting

    More precisely it change the craft you want to give you a knoledge book instead of what you want and give you an achievement.


    When the achievement is detected, it remove the knoledge book and give you the iitem enchanted. Here a new link


    https://mega.nz/file/FJsgSDLI#lC9unS-9XGDbZ9mfIjUkQ99vSLyqgyBVY2H7yUyMM6k

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Serving Food to Customers in my minigame - command blocks

    Hey !


    I rebuilt your system to the start, because it was more simple this way ^^

    I put it in a random system with only command block, which is more reliable and it's made with scores so you can use it anywhere.


    You can look at the image below, and I will explain it.


    Number 1 : It's the randomizer. It's one of the methods to do it, for me it's the best. How it works ? You spawn an area effect cloud, you take his UUID and you put a modulo with the number of choices you want.

    Here the commands to put on the commands block following the arrow :


    summon area_effect_cloud ~ ~ ~ {Tags:["random_uuid"]}
    execute store result score #random random run data get entity @e[type=area_effect_cloud,tag=random_uuid,limit=1] UUID[0] 1
    scoreboard players operation #random random %= #choice_number random
    kill @e[type=area_effect_cloud,tag=random_uuid]



    Number 2 : Here is a timer. In a scoreboard, you put a number that will decrease each ticks and when it reach 0, it starts another command.

    Following the arrow 2, the commands are :

    scoreboard players set #timer random 50
    execute if score #timer random matches 1.. run scoreboard players remove #timer random 1
    execute if score #timer random matches 0 run setblock ~-4 ~ ~ minecraft:redstone_block

    You can add some command block after, if you want to do something while the timer is decreasing.


    Number 3 : When the timer reach 0, it will spawn a redstone block here that will start that line of command block. Depending of the random number, it will put a redstone block in front of one of the commands block below.

    Following the arrow 3, the commands are :


    setblock ~1 ~ ~ air
    execute if score #random random matches 0 run setblock ~ ~ ~-2 minecraft:redstone_block
    execute if score #random random matches 1 run setblock ~ ~ ~-2 minecraft:redstone_block
    execute if score #random random matches 2 run setblock ~ ~ ~-2 minecraft:redstone_block



    Number 4 : It is one of these commands block that will be powered, depending of the random number. So here, you will check if the chest contain what you want and if it's okay, you put some chain command block after.

    In this commands block, you will have someting like this :


    execute if block ~ ~ ~ chest{Items:[{id:"minecraft:cobblestone"}]}



    don't forget to replace the redstone block next to the command block by air once the player has the right command in the chest.

    And in the end, spawn a new redstone block in the middle of numbers 1, 2 and 5 to restart a new order.


    Number 5 : it's just for when you spawn a redstone block above the command block on the number 1, you have to remove it. The command here is


    setblock ~1 ~1 ~ air



    Number 6 : It's the scores you will need to do what I say below, setup the random score and the number of choice you want :


    scoreboard objectives add random dummy
    scoreboard players set #choice_number random 3


    You only have to active this once.


    If you have questions (and I think you will have because I'm bad to explain), fell free to ask me in mp ;)

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on End crystal beam pointing at armor stand

    You can use the "execute store" function to do it, like that :


    /execute store result entity @e[type=minecraft:end_crystal,limit=1] BeamTarget.X double 1 run data get entity @e[type=armor_stand,limit=1] Pos[0]
    /execute store result entity @e[type=minecraft:end_crystal,limit=1] BeamTarget.Y double 1 run data get entity @e[type=armor_stand,limit=1] Pos[1]
    /execute store result entity @e[type=minecraft:end_crystal,limit=1] BeamTarget.Z double 1 run data get entity @e[type=armor_stand,limit=1] Pos[2]
    Posted in: Commands, Command Blocks and Functions
  • To post a comment, please .