Note that currently (14w05b), you cannot check for spaces in strings, which will hopefully be fixed before 1.8 comes out.
Using the /testfor command to check for a dropped item (note that this is exclusive to /testfor, as commands like /kill and /tp do not support dataTags, thus you can't do anything to the specific item found):
Specifically I want to have my players type a spell into a book and have something effect them.
The problem is I cannot determine a way to tag the player who typed a spell with a Scoreboard flag (dummy) so I can filter subsequent command to affect / refer to the player who typed the spell into their book.
I have been searching and found the forums here to be the most complete / informative...
Infinity Dungeon uses the: /clear @a minecraft:writable_book 0 1 {pages:["Text_to_test_for"]} command block that sends out a signal to effect all players. I want it to specify the specific player who typed in the book.
Sethbling uses the scoreboard to flag a player in his Idle Player detector
()
and I want to do the same for a player who uses their writable_book.
I tried creating a scoreboard objective UsedBook type stat.useItem.386 in the hope it would increment when ever a player edited the text in the book (the intent is to flag them as currently wanting to cast a spell)... but no luck (or no skill in setting it up right)
I tried using testfor, but it does not assign scoreboard values. It only tests for them.
The /clear command seams to be the best starting point thus far; but I can't find a way to pass the player that is found to have a item forward to the next command block.
I think that I can't do this with the tools we have at hand. But if I am wrong... maybe one of you has a suggestion?
But so there is no way to detect potion effects on an entity and than do something with this entity?
Unfortunately no. The /testfor command requires you to label all tags within the "ActiveEffects" tag. This includes the "Duration" tag, which decreases by 1 per tick. Not even the fastest clock in the game can detect this, as the signal would only last a single tick, which is too fast for a comparator to activate from.
What if you have several command blocks, each checking for a different duration? (1000,999,998,997...)
This wouldn't matter, as each command block separately would still only have an output last a single tick, and comparators can't be shared amongst several command blocks.
New Snapshot! Dose it works with the new execute command?
The execute command is unrelated to this; its purpose is to use commands relative to entities or players.
However, Dinnerbone has redone the inventory code, which resulted in list-type tags being easier to test for. You can now test for a single active effect and only need to include the "Id" tag:
/testfor @p {ActiveEffects:[{Id:1b}]}
The "b" is required, labeling the tag-type of "byte". With this change, all list-types have been included, meaning inventories can be easily checked now without having to label every single item and every tag. This includes player inventories, chests, ender items, droppers, hoppers, dispensers, etc.
Other list-types that have been fixed up for this include: Attributes/AttributeModifiers, Equipment, DropChances, Villager Recipes, SpawnPotentials for spawners, CanDestroy/CanPlaceOn, ench, CustomPotionEffects, Lore, Pages, and Explosions for fireworks.
which spawns fire where the snowball lands. I want to have different names on different snowballs which do different things. I thought (as I think I did it before somewhere...) that you could do [type=Snowball, name=Fire] , which would find a snowball named fire and then do it. I am forgetting something simple?
Is there a list of all the characters to add depending on the way the value is stored for example
{Id:1b} - Byte
why is it not needed for the name?
{Name:"Test"}
Rollback Post to RevisionRollBack
I make stuff on youtube check me out there gentlegiantJGC
Is there a list of all the characters to add depending on the way the value is stored for example
{Id:1b} - Byte
why is it not needed for the name?
{Name:"Test"}
Essentially each tag will have the first letter of the tag-type as the label. Strings are defined merely by the quotation marks, though all tags that are strings don't have any issues with type labeling (apart from standard syntax rules). So from the list:
Byte = b
Short = s
Int = i
Long = l
Float = f
Double = d
Byte Array = b (each individual value)
String = ""
List = none
Compound = none
Int Array = i (each individual value)
Essentially each tag will have the first letter of the tag-type as the label. Strings are defined merely by the quotation marks, though all tags that are strings don't have any issues with type labeling (apart from standard syntax rules). So from the list:
Byte = b
Short = s
Int = i
Long = l
Float = f
Double = d
Byte Array = b (each individual value)
String = ""
List = none
Compound = none
Int Array = i (each individual value)
thanks
Rollback Post to RevisionRollBack
I make stuff on youtube check me out there gentlegiantJGC
How do you test for a player that is looking at a specific mob (mainly enderman)
There is no way you can test for that unless the mob in question is summoned at a specific location and can never move, in which you would be testing the rotation of the player along with their coordinates rather than what they're looking at. They would have to stand at an exact location and then face a specific direction.
Hey, Is possible to use testfor like this: /testfor @e[type=Zombie,Pig] so comparator lights up if it find zombie or pig. if it is possible how?? i can't find way to do that
You cannot specify more than one value for a parameter and can only have one of each parameter in the player selector. What you could do is use the /scoreboard command to assign scores to specific entities, and then use the /testfor to check the scores:
/scoreboard players set @e[type=Pig] OBJECTIVE 1
/scoreboard players set @e[type=Zombie] OBJECTIVE 1
And then the single /testfor would be:
/testfor @e[score_OBJECTIVE_min=1]
Or just have two separate /testfor's for each type and use physical redstone to create a simple OR gate, such as:
When I try to use the testfor command to test if a player was on a specific team using /testfor @p[team=x] the command blocks output section states "The entity UUID provided is in an invalid format" This and a few other testfor commands i would like to use get the same output. Even /testfor @a[x,y,z,r] does! Is there any way you could explain how to use these commands?
When I try to use the testfor command to test if a player was on a specific team using /testfor @p[team=x] the command blocks output section states "The entity UUID provided is in an invalid format" This and a few other testfor commands i would like to use get the same output. Even /testfor @a[x,y,z,r] does! Is there any way you could explain how to use these commands?
That error occurs when there is no player/entity that matches the parameters. You'll just have to ensure that you have no spaces at all in the parameters and no periods, and that a player matches the parameters (so a player being on the specified team or location).
You won't be able to test if it's been specifically renamed in an anvil, but you can test player inventories for named items:
Note that currently (14w05b), you cannot check for spaces in strings, which will hopefully be fixed before 1.8 comes out.
Using the /testfor command to check for a dropped item (note that this is exclusive to /testfor, as commands like /kill and /tp do not support dataTags, thus you can't do anything to the specific item found):
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/
)
into my vanilla Minecraft server.
Specifically I want to have my players type a spell into a book and have something effect them.
The problem is I cannot determine a way to tag the player who typed a spell with a Scoreboard flag (dummy) so I can filter subsequent command to affect / refer to the player who typed the spell into their book.
I have been searching and found the forums here to be the most complete / informative...
Infinity Dungeon uses the: /clear @a minecraft:writable_book 0 1 {pages:["Text_to_test_for"]} command block that sends out a signal to effect all players. I want it to specify the specific player who typed in the book.
Sethbling uses the scoreboard to flag a player in his Idle Player detector
()
and I want to do the same for a player who uses their writable_book.
I tried creating a scoreboard objective UsedBook type stat.useItem.386 in the hope it would increment when ever a player edited the text in the book (the intent is to flag them as currently wanting to cast a spell)... but no luck (or no skill in setting it up right)
I tried using testfor, but it does not assign scoreboard values. It only tests for them.
The /clear command seams to be the best starting point thus far; but I can't find a way to pass the player that is found to have a item forward to the next command block.
I think that I can't do this with the tools we have at hand. But if I am wrong... maybe one of you has a suggestion?
Thanks
Unfortunately no. The /testfor command requires you to label all tags within the "ActiveEffects" tag. This includes the "Duration" tag, which decreases by 1 per tick. Not even the fastest clock in the game can detect this, as the signal would only last a single tick, which is too fast for a comparator to activate from.
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/
This wouldn't matter, as each command block separately would still only have an output last a single tick, and comparators can't be shared amongst several command blocks.
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/
The execute command is unrelated to this; its purpose is to use commands relative to entities or players.
However, Dinnerbone has redone the inventory code, which resulted in list-type tags being easier to test for. You can now test for a single active effect and only need to include the "Id" tag:
The "b" is required, labeling the tag-type of "byte". With this change, all list-types have been included, meaning inventories can be easily checked now without having to label every single item and every tag. This includes player inventories, chests, ender items, droppers, hoppers, dispensers, etc.
Other list-types that have been fixed up for this include: Attributes/AttributeModifiers, Equipment, DropChances, Villager Recipes, SpawnPotentials for spawners, CanDestroy/CanPlaceOn, ench, CustomPotionEffects, Lore, Pages, and Explosions for fireworks.
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.e., I have which spawns fire where the snowball lands. I want to have different names on different snowballs which do different things. I thought (as I think I did it before somewhere...) that you could do [type=Snowball, name=Fire] , which would find a snowball named fire and then do it. I am forgetting something simple?
20-Base Number system for the win.
{Id:1b} - Byte
why is it not needed for the name?
{Name:"Test"}
I make stuff on youtube check me out there gentlegiantJGC
You'll be looking at the NBT format page on the wiki: http://minecraft.gamepedia.com/Nbt_format
Essentially each tag will have the first letter of the tag-type as the label. Strings are defined merely by the quotation marks, though all tags that are strings don't have any issues with type labeling (apart from standard syntax rules). So from the list:
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/
thanks
I make stuff on youtube check me out there gentlegiantJGC
There is no way you can test for that unless the mob in question is summoned at a specific location and can never move, in which you would be testing the rotation of the player along with their coordinates rather than what they're looking at. They would have to stand at an exact location and then face a specific direction.
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 type (copy&paste) what I find in the opening post:
...and get a villager as expected.
Then I paste:
and it outputs:
(on the Minecraft menu screen)
Minecraft 1.7.2
MCP 9.01-pre
FML 7.2.116.1024
Minecraft Forge 10.12.0.1024
Forge Mod Loader 7.2.116.1024
Minecraft Forge 10.12.0.1024
TooManyItems 1.7.2
Grim3212 Core 0.1-1.7.2
EnhancedPortals 1.7.2-3.0.0b6c
ExtraButtons 1.7.2.0
Hopper Ducts 1.3
kris91268's Light Bridges and Doors 0.1.9
LunatriusCore 1.0.1.4
RedstonePaste 1.7.2-1.6
ReiMinimap-Forge 1.7.2-1.0
SecurityCraft 1.5-pre
You cannot specify more than one value for a parameter and can only have one of each parameter in the player selector. What you could do is use the /scoreboard command to assign scores to specific entities, and then use the /testfor to check the scores:
And then the single /testfor would be:
Or just have two separate /testfor's for each type and use physical redstone to create a simple OR gate, such as:
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/
Yes...
"/testforblock x y z hopper dataValue {Items:[{id:ItemID,Count:HowMuch,Slot:WhichSlotFrom0,Damage:DamageValue,tag:{MoreDataAboutTheItem}}]}
He means a hopper minecart, not a hopper. Same dataTags though, just different command:
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/
That error occurs when there is no player/entity that matches the parameters. You'll just have to ensure that you have no spaces at all in the parameters and no periods, and that a player matches the parameters (so a player being on the specified team or location).
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/
This command tests for entities within a radius from the Command Block:
This one tests for entities within a radius from the given coordinates: