🧮 SCore Variables
SCore variables
Score has a integration of variables where you can store strings/numbers in variables in a global way or per player, they aren't integrated in EI or EB, but they are integrated as commands (so they can be used in combination with EI / EB)
They are stored in plugins/Score/variables
Variable Types
STRING
Allow you to store text
NUMBER
Allow you to store number
LIST
Allow you to store multiple values
Variable Scope (For)
GLOBAL
Variable stored in a global way means that there is one value and its the same for everyone
PLAYER
Variable stored for each player means that the value is independent for each player. So the value of two different players can be not the same.
Modification Types
SET
You set a static value to the variable
MODIFICATION
You modify the variable (useful for INT variables, to add value to a integer value, or to substract a certain value)
LIST-ADD
Specific for LIST , It adds a new value into the list
LIST-REMOVE
Specific for LIST , It removes a value from the list
ID of the variables can't have underscores, points or spaces but - is ok
Variables tools
/score variables list
Display all existing variables IDs
/score variables info {variable-id} [player]
Display the value of a specific variable (Optional: for a specific player)
/score variables-create {variable-id}
Create a new variable with the id mentioned and open the in-game editor
/score variables-define {variable-id} {type_of_variable} {for} [material_icon] [default_values...]
Allow to create a new variable using a command
/score variables-delete {variable-id}
Delete the variable with the id mentioned
/score variables
Open the in-game editor of variables
/score variables clear {type_of_variable} {variable-id} [player]
Clear the value of the variable (Optional: for a specific player)
If you replace [player] by all, it will clear the value for all players
/score variables {modification_type} {variable_scope} {variable-id} {value} [player]
Allow you to modify the value of an existing variable.
Examples:
GLOBAL Variables:
/score variables SET GLOBAL exemple1 100
Set the value 100 to the global variable exemple1
/score variables MODIFICATION GLOBAL plop 100
Increase the global variable plop of +100
/score variables MODIFICATION GLOBAL plop -50
Decrease the global variable plop of -50
PLAYER Variables
/score variables SET PLAYER my-variable -20 Ssomar
Set the value -20 to the variable my-variable for the player Ssomar
/score variables MODIFICATION PLAYER my-variable -50 Ssomar
Decrease the player variable my-variable of -50 for Ssomar
Specific examples for LIST type
/score variables list-add PLAYER ThisIsTheNameOfMyVariable TEXT1 Ssomar
Add values into the list
/score variables list-add PLAYER ThisIsTheNameOfMyVariable TEXT3 Ssomar index:0
To specify a place to add the value into the list use index feature (0 is the first element of the list, so it will add TEXT3 at the begin of the list)
/score variables list-remove PLAYER ThisIsTheNameOfMyVariable Ssomar
Remove the last value
/score variables list-remove PLAYER ThisIsTheNameOfMyVariable Ssomar index:0
Remove a specific index
/score variables list-remove PLAYER ThisIsTheNameOfMyVariable Ssomar value:Test
Remove a specific value
Variables placeholders
This requires PlaceholderAPI.
%score_variables_<variable-id>%
%score_variables_<variable-id>_int%
Placeholders specific for LIST
%score_variables_<variable-id>_<index>%
Return the value at the specific index of the list
%score_variables_<variable-id>%
Return all the elements of the list
%score_variables-contains_<variable-name>_<value>%
Return a boolean to see if the list contains a value (true or false)
%score_variables-size_<variable-name>%
Return the size of the list
What you can do with this feature -> Item created by Ssomar
ExecutableItems (Item variables)
ExecutableItems has a integration of variables where you can store strings/numbers/list in variables inside the item. With them you can create multiple mechanics in your items.
To check the placeholders of "Internal item variables" check it here
📚PlaceholdersExecutableBlocks (Block variables)
ExecutableBlocks has a integration of variables where you can store strings/numbers/list in variables inside the block. With them you can create multiple mechanics in your blocks.
To check the placeholders of "Internal item/block variables" check it here
📚PlaceholdersLast updated