The Meaning of Life, the Universe, and Everything.
Join Date:
4/20/2013
Posts:
276
Location:
memetopia
Minecraft:
WobbegongWachong
Member Details
Run the following in the console:
/scoreboard objectives add inGround dummy
This will create a dummy scoreboard objective inGround to track the NBT data tag of the same name (which is equal to 1 when an arrow is embedded in the ground and equal to 0 when an arrow is not).
Since the objective is dummy, you'll need to run a few commands on a clock to actually link up the NBT data to the scoreboard (unfortunately, Minecraft doesn't currently support reading and writing NBT data to a scoreboard objective).
To do this, run the following commands on a clock:
/scoreboard players set @e[type=Arrow] inGround 0 {inGround:0b}
/scoreboard players set @e[type=Arrow] inGround 1 {inGround:1b}
Now you can execute commands from arrows that are in the ground and arrows that are not in the ground by targeting the arrow entities with specific inGround scores.
In your example, you would want to target and kill an arrow with an inGround score of 1, so your command would look like this:
The Meaning of Life, the Universe, and Everything.
Location:
Nebraska
Join Date:
12/22/2014
Posts:
53
Member Details
Actually, is it possible to detect when a specific item is thrown on the ground? Not just any of one item, but one special item. Say, a stone named patrick will do something but throwing a normal stone wont.
Actually, is it possible to detect when a specific item is thrown on the ground? Not just any of one item, but one special item. Say, a stone named patrick will do something but throwing a normal stone wont.
You'll be doing the same as before, setting a score based on NBT data:
/scoreboard players set @e[type=Item] SpecialItem 1 {Item:{id:"minecraft:stone",tag:{display:{Name:"patrick"}}}}
Can you describe your intention? Getting coordinates as scoreboard values is difficult. If you want to run commands at the location of the item specifically, you use /execute: http://minecraft.gamepedia.com/Commands#execute
Run the following in the console:
This will create a dummy scoreboard objective inGround to track the NBT data tag of the same name (which is equal to 1 when an arrow is embedded in the ground and equal to 0 when an arrow is not).
Since the objective is dummy, you'll need to run a few commands on a clock to actually link up the NBT data to the scoreboard (unfortunately, Minecraft doesn't currently support reading and writing NBT data to a scoreboard objective).
To do this, run the following commands on a clock:
Now you can execute commands from arrows that are in the ground and arrows that are not in the ground by targeting the arrow entities with specific inGround scores.
In your example, you would want to target and kill an arrow with an inGround score of 1, so your command would look like this:
www.youtube.com/user/dinodude162
Incredible. Thank you.
Actually, is it possible to detect when a specific item is thrown on the ground? Not just any of one item, but one special item. Say, a stone named patrick will do something but throwing a normal stone wont.
You'll be doing the same as before, setting a score based on NBT data:
You can find all NBT data for entities and tile entities here: http://minecraft.gamepedia.com/Chunk_format
As well as player and item data here: http://minecraft.gamepedia.com/Player.dat_format
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
Is it possible to get that items coordinates?
Can you describe your intention? Getting coordinates as scoreboard values is difficult. If you want to run commands at the location of the item specifically, you use /execute: http://minecraft.gamepedia.com/Commands#execute
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
NVM, I figured that out. Thanks for all your help.