• 1

    posted a message on Help me with execute and scoreboard (SOLVED)

    Question #1:

    /execute as @a unless score @s level matches 1.. run scoreboard players set @s level 0

    For question #2, you will need 1 impulse command block and 1 chain command block. Paste this in the impulse command block:

    scoreboard players set @p level 2

    attach a chain command block to the impulse one, paste this in:

    tp @p <x> <y> <z>

    and set it to always active.

    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on Help me with execute and scoreboard (SOLVED)

    Here you go:

    /execute as @a[scores={level=2}] run tp @s <x> <y> <z>

    Edit:

    you can also place armor stands on all levels, assign the corresponding level number to their scoreboard objective, and teleport the player to the armor stand that has a matching scoreboard objective value. This only works for singleplayer though.

    /execute as @e[type=minecraft:armor_stand] at @s if score @s level = @p level run tp @p ~ ~ ~
    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on How to untame a cat (or any other animal) in MC15.2?

    I did some testing and the game always reverts the value of the OwnerUUID NBT tag to its original value. I also noticed that if you set the value to something random such as "text", the game will revert the value back to the UUID of the player again but the cat won't have a collar anymore, you can't control it and it will follow you around like it is tamed. Maybe there's another tag that has to be reset in order for this to work or maybe it's not even possible because the UUID is stored in memory or something.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Scoreboard of Player Y Values

    Here you go, this works for multiple players:

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

    posted a message on 1.15.2 minecraft server commands with nbt always fail
    Quote from drakodiin»

    Me and a few friends started a minecraft server and are having trouble with all commands that contain nbt data tags


    Example:

    /give @p minecraft:diamond_sword{display:{Lore:["\"A legendary weapon\""]}}


    Error: Unknown item name:minecraft:diamond_sword{display:{lore:["\"a


    Plugins sometimes override default Minecraft commands. And just like mods, each plugin has its own namespace from which you can execute its commands. Minecraft also has its own namespace with all of its default commands. So if you have any plugins installed on the server, try running the command from the minecraft namespace:

    /minecraft:give @p minecraft:diamond_sword{display:{Lore:["\"A legendary weapon\""]}}
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on I need help with moving entities (1.14.4)

    Your first command teleports all shulkers to ~1 ~ ~ but because you used "at @e[name=1]", the position of ~1 ~ ~ changed to the position of the shulker named "1" (and 1 block to the positive x).


    Use this command instead:

    /execute as @e[type=shulker] at @s run tp @s ~1 ~ ~

    ^ this will teleport all shulkers 1 block towards the positive x.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Command block issues

    In that case, you need to tag the player when they enter the area and untag them when they leave the area. Then, you can use that tag in the selector of your second command. I'm not able to test this method in multiplayer but it should work.


    repeating command block:

    /tellraw @a[<area definition>,tag=!tagged] ...

    chain command block:

    /tag @a[tag=tagged] remove tagged

    another chain command block:

    /tag @a[<area definition>,tag=!tagged] add tagged
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Command block issues

    Simply copy the area definition code from your first selector to the second selector.

    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on Scoreboard Entity Data Counter/Tracker (SOLVED)

    Here you go:

    /execute store result score BlueSheep colorTracker run execute if entity @e[type=sheep,nbt={Color:11b}]

    BlueSheep is a "fake player" and colorTracker is a dummy objective. To add more colors, simply duplicate the command, change the fake player and the color value.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Multiplayer-Friendly loot crate system

    It's in 1.15 but, according to the wiki, its structure is going to be changed in 1.16.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Multiplayer-Friendly loot crate system

    I'm not able to test this but items have an Owner NBT tag which only allows the player with the specified UUID to pick the item up (or at least that's what the wiki states). You could try storing the UUIDMost and UUIDLeast of the player who opened the crate into the item with /data before allowing pickup.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on [1.15.2] Item detection problem

    it's a bit more complex for hoppers because blocks can't be /clear-ed. I've created a dynamic system that counts the number of items in each slot of a hopper and sums the numbers up into another objective. The system utilizes armor stands so you can detect items in multiple hoppers without hardcoding every hopper's coordinates. Simply summon an armor stand on a hopper and give it a "hopper" tag:

    /summon armor_stand ~ ~ ~ {Tags:["hopper"],Invisible:1,Invulnerable:1}

    Keep in mind that if the armor stand is in the hopper, it will be able to detect the hopper with ~ ~ ~. But if the armor stand is on the edge of the hopper blocks, the coordinates should be ~ ~-1 ~.


    Create the following objectives:

    /scoreboard objectives add slot_0 dummy
    /scoreboard objectives add slot_1 dummy
    /scoreboard objectives add slot_2 dummy
    /scoreboard objectives add slot_3 dummy
    /scoreboard objectives add slot_4 dummy
    /scoreboard objectives add total dummy

    place down a repeating command block and attach 11 chain command blocks to it. Paste the following commands into the command blocks (in order):

    /execute as @e[tag=hopper] at @s store result score @s slot_0 run data get block ~ ~ ~ Items[{id:"minecraft:prismarine_shard",Slot:0b}].Count
    
    /execute as @e[tag=hopper] at @s store result score @s slot_1 run data get block ~ ~ ~ Items[{id:"minecraft:prismarine_shard",Slot:1b}].Count
    
    /execute as @e[tag=hopper] at @s store result score @s slot_2 run data get block ~ ~ ~ Items[{id:"minecraft:prismarine_shard",Slot:2b}].Count
    
    /execute as @e[tag=hopper] at @s store result score @s slot_3 run data get block ~ ~ ~ Items[{id:"minecraft:prismarine_shard",Slot:3b}].Count
    
    /execute as @e[tag=hopper] at @s store result score @s slot_4 run data get block ~ ~ ~ Items[{id:"minecraft:prismarine_shard",Slot:4b}].Count
    
    /execute as @e[tag=hopper] run scoreboard players operation @s total += @s slot_0
    /execute as @e[tag=hopper] run scoreboard players operation @s total += @s slot_1
    /execute as @e[tag=hopper] run scoreboard players operation @s total += @s slot_2
    /execute as @e[tag=hopper] run scoreboard players operation @s total += @s slot_3
    /execute as @e[tag=hopper] run scoreboard players operation @s total += @s slot_4
    
    /execute as @e[tag=hopper,scores={total=13..}] at @s run data modify block ~ ~ ~ Items set value []
    /scoreboard players reset @e[tag=hopper,scores={total=1..}] total
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Maximum Scoreboard Points

    Repeating command block:

    /effect give @a[scores={yourObjective=150..}] slowness <duration> <amplifier> <showParticles>

    chain command block connected to the repeating one:

    /scoreboard players reset @a[scores={yourObjective=150..}] yourObjective

    both should be set to always active.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on I need help with an idea.

    It doesn't show up on the screen by default.

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on I need help with an idea.

    Of course, you are allowed to ask for help here.


    For the distancing, I would use the hunger effect because it's much simpler to do than doing a specific amount of damage. This command should do:

    execute at @a run effect give @a[distance=0.1..6] minecraft:hunger 1 0 true
    Posted in: Commands, Command Blocks and Functions
  • To post a comment, please or register a new account.