I realized that when you use a lot of command blocks, it could be a bit time-consuming to do all these coordinates and numbers everywhere so I thought maybe I could introduce variables into Minecraft. Here is how it works.
/variable <add | list | set> //Root command for variable
/variable add <name> <type> [value] [preferences...] //Adds a variable into Minecraft. The types are number, word, coordinate, field, item, entity, and block
/variable list //Lists all the variables, their value, and their type
/variable set <variable> <value> //Sets a value to a variable
To get a variable's value, do this
@v[variable]
Here are the explanations of each type of variable
number - A number. Could be used to store an X Position of an entity or the cost of an item at a shop.
word - Stores a word or letter. Could be used for predefined messages a command block would say repeatedly.
coordinate - Stores a coordinate. Could be used for easier teleportation methods.
field - Stores a field between 2 coordinates. Could be used for easier /fill methods. To set in a variable command, use 2 coordinates or 6 numbers (which basically represents 2 coordinates)
item - Stores the name of an item.
entity - Stores a specific entity or a generic one
block - Stores the name of a block
Here are some methods you could use to set variables
/variable add creeperX num @e[type=Creeper,c=1].getX
/variable add nearName word @p.name
Here's the list of all these methods
@e[].getX //num
@e[].getY //num
@e[].getZ //num
@e[].name //word
@e[].slot.armor.head.name //word
@e[].slot.weapon //item
@e[].getCoordinate //coordinate
@e[].getViewCoord //coordinate
@e[].getViewBlock //block
block.getX //number
@e[].getHeldItem //item
@e[].getEntity //entity
@e[].getSpecificEntity //entity
@e[].getViewEntity //entity
((1 + 5) * 24) //number
@e[].getUUID //word
@e[].getMobType //entity
@e[].getNBTTag.(nbtTag) //varies
block.Name //word
@e[].scoreboardValue.(scoreboard name) //word
You could also add a certain list of preferences to these commands
final - Sets this variable to be unchanging
Here are examples of how you could use these
Method 1 - get distance between you and the block you are looking at
/variable add distanceNum num @p.getCoordinate - @p.getViewCoordinate //gets the distance between where you are and the coordinate of where you are looking at. Notice how you could subtract two coordinates to get a distance
/say @v[distanceNum] //says the distance
Method 2 - Stealing a persons armor when you are 1 block away from someone
/variable add distance num //adds a variable called distance
/variable add thief entitiy @p.getSpecificEntity //gets the nearest player and makes them a thief
/variable set distance thief.getCoordinate - @p[!@v[thief]].getCoordinate //sets the distance variable to the distance between the thief and the nearest player who is not a thief
/testfor @v[distance]<1 //tests if distance is less than 1. You are allowed to do <, >, =,<=,>=, and != to test number variables
/variable add victim entity @p[!@v[thief]] //adds the victim as the nearest player who isn't the thief
/replaceitem entity @e[@v[thief]] slot.armor.head @e[@v[victim]].slot.armor.head //replaces the helmet
/replaceitem entity @e[@v[thief]] slot.armor.chest @e[@v[victim]].slot.armor.chest //replaces the chestplate
/replaceitem entity @e[@v[thief]] slot.armor.legs @e[@v[victim]].slot.armor.legs //replaces the leggings
/replaceitem entity @e[@v[thief]] slot.armor.feet @e[@v[victim]].slot.armor.feet //replaces the boots
/clear @e[@v[victim]] @e[@v[victim]].slot.armor.head //deletes the victims helmet
/clear @e[@v[victim]] @e[@v[victim]].slot.armor.chest //deletes the victims chestplate
/clear @e[@v[victim]] @e[@v[victim]].slot.armor.legs //deletes the victims leggings
/clear @e[@v[victim]] @e[@v[victim]].slot.armor.feet //deletes the victims boots
This has been suggested before, but never in this much detail. You have really put time into making this very powerful and easy to use. You have my absolute and total support.
Would variables be global (could be used by any command block)? If so, there could be an issue with accidentally using an existing
Also, I would like to suggest a few methods which would be useful:
@e[].nameUUID - This gets a players name, but as that player's UUID rather than the in game name. //word
@e[].getMobType - if given a mob's UUID, it will tell you the ID of that mob. //word
@e[].getnbt.[nbt tag] - This would get the value of a specified NBT tag. //varies
Note that almost anything is possible if you can look at an entity's NBT tags. You could check health, the equipped item, what's in it's inventory, if it is hostile, if a creeper if charged or if a dog is tamed.
I would love to see editing the NBT values of existing mobs, but that is an idea for a different topic (i'm sure they're out there). I don't want to see this become a wishlist.
Support, there's no reason not to add this. For a puzzle/adventure mapmaker, this could be handy!
Rollback Post to RevisionRollBack
My Avatar is a Dalek, therefor your argument is... EXTERMINATED!!!
You know who can tell me something I already know? Me. All the time. I'm really good at telling me stuff I already know. I don't need help in that department. I don't know about others, but I can't imagine I'm alone here.
/variable <add | list | set> //Root command for variable
/variable add <name> <type> [value] [preferences...] //Adds a variable into Minecraft. The types are number, word, coordinate, field, item, entity, and block
/variable list //Lists all the variables, their value, and their type
/variable set <variable> <value> //Sets a value to a variable
To get a variable's value, do this
@v[variable]
Here are the explanations of each type of variable
number - A number. Could be used to store an X Position of an entity or the cost of an item at a shop.
word - Stores a word or letter. Could be used for predefined messages a command block would say repeatedly.
coordinate - Stores a coordinate. Could be used for easier teleportation methods.
field - Stores a field between 2 coordinates. Could be used for easier /fill methods. To set in a variable command, use 2 coordinates or 6 numbers (which basically represents 2 coordinates)
item - Stores the name of an item.
entity - Stores a specific entity or a generic one
block - Stores the name of a block
Here are some methods you could use to set variables
/variable add creeperX num @e[type=Creeper,c=1].getX
/variable add nearName word @p.name
Here's the list of all these methods
@e[].getX //num
@e[].getY //num
@e[].getZ //num
@e[].name //word
@e[].slot.armor.head.name //word
@e[].slot.weapon //item
@e[].getCoordinate //coordinate
@e[].getViewCoord //coordinate
@e[].getViewBlock //block
block.getX //number
@e[].getHeldItem //item
@e[].getEntity //entity
@e[].getSpecificEntity //entity
@e[].getViewEntity //entity
((1 + 5) * 24) //number
@e[].getUUID //word
@e[].getMobType //entity
@e[].getNBTTag.(nbtTag) //varies
block.Name //word
@e[].scoreboardValue.(scoreboard name) //word
You could also add a certain list of preferences to these commands
final - Sets this variable to be unchanging
Here are examples of how you could use these
Method 1 - get distance between you and the block you are looking at
/variable add distanceNum num @p.getCoordinate - @p.getViewCoordinate //gets the distance between where you are and the coordinate of where you are looking at. Notice how you could subtract two coordinates to get a distance
/say @v[distanceNum] //says the distance
Method 2 - Stealing a persons armor when you are 1 block away from someone
/variable add distance num //adds a variable called distance
/variable add thief entitiy @p.getSpecificEntity //gets the nearest player and makes them a thief
/variable set distance thief.getCoordinate - @p[!@v[thief]].getCoordinate //sets the distance variable to the distance between the thief and the nearest player who is not a thief
/testfor @v[distance]<1 //tests if distance is less than 1. You are allowed to do <, >, =,<=,>=, and != to test number variables
/variable add victim entity @p[!@v[thief]] //adds the victim as the nearest player who isn't the thief
/replaceitem entity @e[@v[thief]] slot.armor.head @e[@v[victim]].slot.armor.head //replaces the helmet
/replaceitem entity @e[@v[thief]] slot.armor.chest @e[@v[victim]].slot.armor.chest //replaces the chestplate
/replaceitem entity @e[@v[thief]] slot.armor.legs @e[@v[victim]].slot.armor.legs //replaces the leggings
/replaceitem entity @e[@v[thief]] slot.armor.feet @e[@v[victim]].slot.armor.feet //replaces the boots
/clear @e[@v[victim]] @e[@v[victim]].slot.armor.head //deletes the victims helmet
/clear @e[@v[victim]] @e[@v[victim]].slot.armor.chest //deletes the victims chestplate
/clear @e[@v[victim]] @e[@v[victim]].slot.armor.legs //deletes the victims leggings
/clear @e[@v[victim]] @e[@v[victim]].slot.armor.feet //deletes the victims boots
/say @v[thief].Name stole @v[victim].Name 's armor!
If you need any help understanding what I just said, please leave a comment and I hope that you support variables!
Want just some fun YouTube videos? http://www.youtube.com/jaboyc999
Even though some of these commands aren't very useful (e.g. see the distance between you in a certain block), why not? I like these sort of commands.
Want just some fun YouTube videos? http://www.youtube.com/jaboyc999
~ I support the "new" EULA ~
Want just some fun YouTube videos? http://www.youtube.com/jaboyc999
Genius idea.
Want just some fun YouTube videos? http://www.youtube.com/jaboyc999
I have a special ability to change colors, I can change into just about any Color.
I got this special ability from eating a Grand Star.
Want just some fun YouTube videos? http://www.youtube.com/jaboyc999
Im trying to make an adventure map just by myself, and some of the commands would be very nice to it.
This is the exact reason I want this! It would be so nice to have this!
Want just some fun YouTube videos? http://www.youtube.com/jaboyc999
You have my full support!
Also, I have an idea. What if you made it so you can add/subtract/mutliply/divide variables? That would be very helpful!
You could do that, its listed as the last method! Thanks for the support!
Want just some fun YouTube videos? http://www.youtube.com/jaboyc999
Also, I would like to suggest a few methods which would be useful:
@e[].nameUUID - This gets a players name, but as that player's UUID rather than the in game name. //word
@e[].getMobType - if given a mob's UUID, it will tell you the ID of that mob. //word
@e[].getnbt.[nbt tag] - This would get the value of a specified NBT tag. //varies
Note that almost anything is possible if you can look at an entity's NBT tags. You could check health, the equipped item, what's in it's inventory, if it is hostile, if a creeper if charged or if a dog is tamed.
I would love to see editing the NBT values of existing mobs, but that is an idea for a different topic (i'm sure they're out there). I don't want to see this become a wishlist.
~yoshi9048
My best suggestion:
Mobs actually being varied???