Minecraft using player score as a variable

Minecraft using player score as a variable - Gathering Football Players

In a map I'm making I have a command block loop, and for every time it loops all players speed increases by 1 tier. Anyone know how to do this?



Best Answer

While being able to take a value from a scoreboard and use it as the tier of an effect would be nice, it is impossible without using many command blocks (one for each tier).

I'll give an idea of how I'd do it:

It's nice and easy to increment scoreboards using

/scoreboard players add @a <scoreboard name> 1

You could use a dummy player instead of every player, but doing it this way, you can exclude players (maybe when they die, or when they do, they're speed is reset).

Then in a bunch of command blocks (in 1.9 chain command blocks come in handy) put in each block:

/effect @a[score_<scoreboard>_min=<x>,score_<scoreboard>=<x>] speed <seconds> <x>



Pictures about "Minecraft using player score as a variable"

Minecraft using player score as a variable - Focused ethnic female DJ playing music at nightclub
Minecraft using player score as a variable - Crop young African American female football player practicing with ball in training in sunny day
Minecraft using player score as a variable - Young African American female football player trying scoring goal in training in sunny day



How do you code a scoreboard in Minecraft?

Scoreboard Command
  • To add an objective: /scoreboard objectives add <objective> <criteria> [displayName]
  • To remove an objective: /scoreboard objectives remove <objective>
  • To list all objectives: /scoreboard objectives list.
  • To set how the objectives are displayed: /scoreboard objectives setdisplay <slot> [objective]


  • Can you use variables in Minecraft commands?

    Minecraft commands do have a form of variables, but, unfortunately, they can only store numeric values. This is called the scoreboard, and you can add and access variables by using the /scoreboard command.



    Minecraft Scoreboard Command Tutorial [1.18]




    More answers regarding minecraft using player score as a variable

    Answer 2

    You could have the /effect speed code in a repeating command block or if you want it to happen slower, have it on a clock. If you wanted to have the speed go up after each loop, you cold have multiple command blocks with the different commands and use pistons after each clock loop to enable them to be powered.

    Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

    Images: Pixabay, Fardad Postwala, RF._.studio, RF._.studio