The new 'entity' selector (@e) can be used in a small handful of commands, notably the /tp command. There are a few discrepancies:
1. You cannot affect more than 1 entity with the @e selector in the /tp command.
2. The target entity will always be the one with the lowest Entity ID, which would be the one that existed first.
3. For this topic, a bug prevents Arrows from being /kill'd, even though a success message is given.
So here is an example command, which will teleport a Fireball entity to an Arrow:
/tp @e[type=Fireball,c=1] @e[type=Arrow,c=-1]
The Fireball has a "count" of 1. Without this, the command would fail with an obscure error message. This essentially means a Fireball that was summoned before any other fireballs will be teleported to the Arrow.
The Arrow has a "count" of -1. What this does is, instead of selecting the oldest arrow, it will select the newest. This way the player can fire their bow more than once and the new arrow will be affected, rather than the oldest arrow.
So essentially, the long-awaited ability to create custom 'spells'. Unfortunately in its early stage, this isn't all that practical. I'm sure that 1.8 will provide much more capabilities than this.
So @e will only select one enity to teleport...
Thats anoying, is there a way to select all enities (say in a given area)...?
Also, the customs spells thing is awesome, and if you wanted to make it instant and not have an arrow at the end you could use snowballs instead
I assume the lack of being able to select multiple entities is merely a bug, as you can select as many entities as you want in the /testfor command. That, or there is some technical issues with teleporting multiple entities. Unfortunately I have no idea, haven't seen any word on it from Dinnerbone.
That is an extremely good idea, using a snowball instead of arrow. I tried it out and it works very well since the snowball gets destroyed on its own. Sometimes when it lands, the intended entity to teleport to it doesn't reach its mark. Not sure why this is; the clock runs as fast as the game can chug. Most of the time it hits its target, though. A slight issue otherwise is the range, which isn't as good as arrows, but I think it's a huge improvement!
Yeah, i had a look at some other peoples posts and it seems it does affect all entities.
Which is very good indeed
I guess using arrows allows for more variety of ranges to shoot at, but snowballs remove the need for picking up arrows, you could also use, splash potions for short range bombs?
It's extremely finicky; only seems to work if you're on the ground, while aiming low. But the result is absolutely amazing:
I've included snowballs and even enderpearls into the mix. This is going to be a very, very fun update for map makers.
The /testfor command now supports dataTags. However, they are currently fairly bugged and won't detect a large amount of tags. Syntax regardless:
/testfor <Selector> {dataTags}
I've attempted to check specific items in specific slots on a player, such as armor, but unfortunately the "Inventory" tag falls under the same bug that the /testforblock "Items" tag does: you have to include every item in the inventory and know exactly where in the inventory those items are. So if you want to just check for boots in the armor slot, you cannot do this unless that's all the player has in their inventory.
EDIT:
Although, this means dataTags aren't going to be used in selectors themselves, thus you can't target these specific entities after you've detected them.. Shucks, hopefully that's changed.
Hopefully Mojang will make it work smoother eventually. Still works great for adventure maps though if you limit the ammo some how. But I'm working on a PVP map and would love to use something like this and there is just no way. Personally I would love to be able to modify the damage of snowballs.
Although, this means dataTags aren't going to be used in selectors themselves, thus you can't target these specific entities after you've detected them.. Shucks, hopefully that's changed.
I am just gonna point out that this is not true as of 14w10a, as scoreboards can set scores for entities with specific datatags. (Please note, since I know someone with poor comprehension skills will do it, I know this post was made well before 14w10a, but I am saying this for anyone viewing after the snapshot.)
The /tp command does not support NBT data. You would have to assign the arrow a score based on its NBT data and then use the "score" parameter within the /tp command. Proper syntax:
I am in need of some assistance.
Im trying to make a system were, if you chop down a tree, Instead of getting logs you get another item.
and i thought, ill just make it detect the log and delete it and give the player a Wood chip.
But no matter what command i use, none of them work.
I am in need of some assistance.
Im trying to make a system were, if you chop down a tree, Instead of getting logs you get another item.
and i thought, ill just make it detect the log and delete it and give the player a Wood chip.
But no matter what command i use, none of them work.
Was there an update to minecraft were /testfor doesnt work anymore?
Or is there just a new implemented command i havent heard about?
Selector parameters require an equals sign instead of a colon. As well, the /execute command does not support dataTags, so you'll have to use /scoreboard if you want to select a specific entity. The score would be set based on the NBT data, and you'd then target them based on their score. The correct tag for item entity's item data is "Item" rather than "item", being case-sensitive:
note that I am playing in 1.8, but I have, in fact, figured out how to make you teleport to arrows, even though only one at a time, when they stick into the ground. The only problems I've found are when the arrow sticks into the underside of something, or hits a mob. I used a testfor @e[type=Arrow] command block, with a clock attached. Then, I made it so that a comparator powered off a redstone torch, when on, so that when the arrow disapears, it will keep a later part of the circuit off. Then, I made another comparator at the testfor command block, followed by a repeater, a redstone, and then a comparator clock. The extra redstone wire almost in the middle of the contraption is necessary, as, even though it takes a minimal amount of time for redstone to be activated, it still takes those few hundredths of a second. That redstone runs to a command block with execute @e[type=Arrow] ~ ~ ~ detect ~ ~-1 ~ minecraft:air 0 setblock 1292 4 12 minecraft:redstone_block in it. (Please note that 1292 4 12 were just the coordinates I was using, since you cannot use ~ ~ ~, because it places it within coordinates of the arrow.) The redstone on the left, which is noticeably shorter, runs to a command block that has setblock 1292 4 12 minecraft:stone in it. Now, remember the first command block I mentioned after the testfor one? The one that uses that comparator to turn off the redstone torch? Well, this is where that comes into effect, too. You see, redstone blocks are ALWAYS powered, so, having a torch on a redstone block turns it off, but having it on a stone one doesn't. Therefor, since there isn't a block that isn't there when using the setblock command, the torch doesn't disapear. So, since that redstone takes that little bit longer of time, the detecting command block, which sets the redstone block right after the stone one does, it seems like it stays the redstone block. So, until the arrow hits something, so that the block under it isn't air anymore, that redstone torch will go back on. When the torch goes back on, it uses a tp @p @e[type=Arrow] command, with the repeater to the left there going into THAT command block with the command kill @e[type=Arrow] in it. You don't really need this command block, however, is makes it so that you can change the tp command into somethine else, like, say, execute @e[type=Arrow] ~ ~ ~ summon PrimedTnt ~ ~ ~, or, maybe, replace PrimedTnt with LightningBolt, or, even, execute @e[type=Arrow] ~ ~ ~ setblock ~ ~ ~ minecraft:flowing_lava. Anyways, I hope I didn't ramble on TOO bad.
1. You cannot affect more than 1 entity with the @e selector in the /tp command.
2. The target entity will always be the one with the lowest Entity ID, which would be the one that existed first.
3. For this topic, a bug prevents Arrows from being /kill'd, even though a success message is given.
So here is an example command, which will teleport a Fireball entity to an Arrow:
The Fireball has a "count" of 1. Without this, the command would fail with an obscure error message. This essentially means a Fireball that was summoned before any other fireballs will be teleported to the Arrow.
The Arrow has a "count" of -1. What this does is, instead of selecting the oldest arrow, it will select the newest. This way the player can fire their bow more than once and the new arrow will be affected, rather than the oldest arrow.
Here is a video demonstrating several uses:
List of commands: http://pastebin.com/6xEcYvGq
Secondary example:
So essentially, the long-awaited ability to create custom 'spells'. Unfortunately in its early stage, this isn't all that practical. I'm sure that 1.8 will provide much more capabilities than this.
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/
I assume the lack of being able to select multiple entities is merely a bug, as you can select as many entities as you want in the /testfor command. That, or there is some technical issues with teleporting multiple entities. Unfortunately I have no idea, haven't seen any word on it from Dinnerbone.
That is an extremely good idea, using a snowball instead of arrow. I tried it out and it works very well since the snowball gets destroyed on its own. Sometimes when it lands, the intended entity to teleport to it doesn't reach its mark. Not sure why this is; the clock runs as fast as the game can chug. Most of the time it hits its target, though. A slight issue otherwise is the range, which isn't as good as arrows, but I think it's a huge improvement!
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/
It's extremely finicky; only seems to work if you're on the ground, while aiming low. But the result is absolutely amazing:
I've included snowballs and even enderpearls into the mix. This is going to be a very, very fun update for map makers.
EDIT:
Dinnerbone has marked the Arrow /kill bug as fixed for a future version: https://mojang.atlassian.net/browse/MC-44371
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/
I've attempted to check specific items in specific slots on a player, such as armor, but unfortunately the "Inventory" tag falls under the same bug that the /testforblock "Items" tag does: you have to include every item in the inventory and know exactly where in the inventory those items are. So if you want to just check for boots in the armor slot, you cannot do this unless that's all the player has in their inventory.
EDIT:
Although, this means dataTags aren't going to be used in selectors themselves, thus you can't target these specific entities after you've detected them.. Shucks, hopefully that's changed.
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/
I am just gonna point out that this is not true as of 14w10a, as scoreboards can set scores for entities with specific datatags. (Please note, since I know someone with poor comprehension skills will do it, I know this post was made well before 14w10a, but I am saying this for anyone viewing after the snapshot.)
You actually can. It's will look like this.
You cannot. Neither of those have a detectable action.
The /tp command does not support NBT data. You would have to assign the arrow a score based on its NBT data and then use the "score" parameter within the /tp command. Proper syntax:
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/
Im trying to make a system were, if you chop down a tree, Instead of getting logs you get another item.
and i thought, ill just make it detect the log and delete it and give the player a Wood chip.
But no matter what command i use, none of them work.
E.g.
/testfor @e[type:item] {item:{id:minecraft:log}} - Wont Work.
/execute @e[type:item] {item:{id:minecraft:log}} - Wont Work.
Was there an update to minecraft were /testfor doesnt work anymore?
Or is there just a new implemented command i havent heard about?
Selector parameters require an equals sign instead of a colon. As well, the /execute command does not support dataTags, so you'll have to use /scoreboard if you want to select a specific entity. The score would be set based on the NBT data, and you'd then target them based on their score. The correct tag for item entity's item data is "Item" rather than "item", being case-sensitive:
For targeting specific entities:
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/
(sorry for bad gramer)
The scoreboard is for another thing entirely.
Any way to do this with tipped arrows?