• 0

    posted a message on Rookie command block problems

    Yeah, true, if it's in multiplayer, there are two possibilities :


    1) Remove the block. If another player place it, it will give him the item. (To see who place the block, we can have an objectives that store how many of the block have been placed, and when it change, it's this guy who placed on the monument)


    2) Only one player can place the block. To do that, if your players are in adventure mod and cannot break the block, you have nothing to change (Only what I said if you want to know exactly who placed the block). If your players are not in adventure mod, then you can create an objective that you set to 1 to a ghost player and say "if the ghost hasn't the score, then you give the item"

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Shop to buy commands

    No, you can't


    But you can use another method, which is quite complicated.


    You need to use trigger functions. Create just one called "market", that will execute a tellraw to the one who called it.

    In that tellraw, you put things like :


    Fill function -> 10$ [BUY]


    and you create a click event on [BUY]. Then you just have to run a function associate to it as him.


    I recommand you to use datapack to do that, it will be simplier if you want your players to have access to /fill for exemple, because they will not have access to the command but to a substitute you will code. If you need help, don't hesitate to post here, I'll answer.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on How would I detect if somebody has died, and then send a tellraw saying the person has died, and how long they survived for.

    Hello !


    I recommand you to not use redstone, it can be laggy, it's no good, create a timer with only command block !



    scoreboard objectives add timer dummy
    scoreboard objectives add second dummy
    scoreboard players add @a time 1
    scoreboard players add @a[scores={time=20}] second 1
    scoreboard players set @a[scores={time=20}] time 0

    The first two ones only has to be executed one time, the third and fourth command has to be set in repeat unconditional always active and the last in chain conditional always active.


    And for telling players when someone is dead, why do you have to create a clock ? A command block can be put in repeat mode, and execute your fonction every tick ! With that in mind, you just have to create the death objective like you did, and tell players when someone die, then reset his scores.



    scoreboard objectives add death deathCount
    execute as @a[scores={death=1}] run tellraw @a [{"selector":"@s","color":"red"},{"text":" has died, surviving for ","color":"gold"},{"score":{"name":"@s","objective":"second"},"color":"aqua"},{"text":" seconds.","color":"gold"}]
    scoreboard players set @a[scores={death=1}] second 0
    scoreboard players set @a[scores={death=1}] death 0

    The first command block in repeat always active unconditional

    The second one in chain conditional always active

    the third in chain conditional always active

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Rookie command block problems

    hexa, you can just give the player a tag :


    execute if block ~ ~1 ~ minecraft:emerald_block run give @p[tag=!give] minecraft:acacia_door
    tag @p add give


    the first command in a repeat unconditional always active command block and the second in a chain conditional always active command block

    With that, you can even remove the tag when he does an action to reset all.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Showing multiple objectives in the scoreboard

    You can alternate between objectives, like that :


    scoreboard objectives add time dummy
    scoreboard objectives add health health
    scoreboard objectives add deathCount deathCount
    scoreboard players add #time time 1
    execute if score #time time matches 100 run scoreboard objectives setdisplay sidebar health
    execute if score #time time matches 200 run scoreboard objectives setdisplay sidebar deathCount
    execute if score #time time matches 200 run scoreboard players set #time time 0
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Xp Currency: completing jobs for xp with command blocks

    Your problem here is that you put ".." in an nbt tag, which want the exact number.

    You can just save how many log the player has and stock it in a score, like this :


    execute as @p store result score @s nb_log run clear @s oak_log 0
    execute as @p if score @s nb_log matches 4.. run xp add @s 1 levels
    execute as @p if score @s nb_log matches 4.. run tellraw @s {"text":"Thank you, I have rewarded you for your hardwork!","color":"green"}
    execute as @p if score @s nb_log matches 4.. run playsound minecraft:block.note_block.pling ambient @s ~ ~ ~ 5 2
    clear @p minecraft:oak_log 4
    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on spawn a witch that can't heal itself

    You have to modify what she have in his hand. Use that code in command block repeat :


    execute as @e[type=minecraft:witch] run data modify entity @s HandItems set value [{}]
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on How to make particles follow a curved path Minecraft 1.16.3

    maybe if you spawn a mob with noAI, and you gave it a motion, then you spawn particles all tick on it ? I'll go try it.

    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on What's wrong with this code?

    In "execute if", you cant put >= [number], for that, you have to do that :


    execute if score Tempo: Time matches 0.. run scoreboard players remove Tempo: Time 1
    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on Relative to command block

    You can just put two command block, one who set a score if your condition is correct, and the other which tell if a player got score equal 1, you spawn the redstone block.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on so i wanna make empty some dimensions using a command block

    You have to tell it where you want the command to run. Here you just say "it's the snowball that execute the command" but it will not run where it is. So instead of "as @e", write "at @e"


    execute at @e[type=minecraft:snowball] run fill ~2 ~2 ~2 ~-2 ~-2 ~-2 minecraft:air replace minecraft:end_stone
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Help fixing Dimension Teleporter
    execute store result score @a Hight run data get entity @r Pos[1]

    This line isn't correct, @r is for a random player. Change this line with :


    execute store result score @a Hight run data get entity @s Pos[1]
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on How to summon an Item spawn egg
    /give @p phantom_spawn_egg{EntityTag:{id:"minecraft:item",Item:{id:"minecraft:acacia_button",Count:1b}}}
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Function not found

    [Edit because I'm dumb]

    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on Problem with tp command.

    You have to use


    execute as SilasMikkelsen at @s run tp @s ^ ^ ^ facing entity @e[limit=1,sort=nearest,type=armor_stand]


    With this, the function run at the player's coordinates :)

    Posted in: Commands, Command Blocks and Functions
  • To post a comment, please .