I've tried using the hopper type, the old one without the New repeater block (dont Remember name atm) And with that New one (the one that starts glowing when a command in a command block is fullfilled)
So.. I've tried with three different clock setups, none of them worked for me
I tried this, but it did not work for me! I even copy and pasted your code!
the one I tried to use was:
testfor @p {Inventory:{[ID:minecraft:Lever]}}
Adding picture of code
Can someone please tell me if there is something wrong with it
Thank you
You're not using the 1.8 snapshots; the upgraded /testfor (the "dataTags" syntax addition) is only available in them. As well, your NBT data is incorrect: the "Inventory" tag has a tag-type of "list", which is defined by square brackets instead of curly. The data that's held within the list are unnamed "compound" tag-types, defined by curly brackets. You're missing the tag-name for the item ID, which is simply "id" (note that this is all case-sensitive):
Thank you so much! but now I suffer another problem.. when the command blocks are updated (the clocks turn on and off and on again) the chat is spammed by ''found block at x,y,z'' and ''found <player>''
are there some way I can fix this, hide the command chat or something?
I need the executed commands like /say though to show in the chat.. but I dont need the chat to be spammed by ''found <player>''
Thank you so much! but now I suffer another problem.. when the command blocks are updated (the clocks turn on and off and on again) the chat is spammed by ''found block at x,y,z'' and ''found ''
are there some way I can fix this, hide the command chat or something?
I need the executed commands like /say though to show in the chat.. but I dont need the chat to be spammed by ''found ''
Yes, you can modify the gamerule 'commandBlockOutput':
/gamerule commandBlockOutput false
There's also the 'logAdminCommands' gamerule, which prevents log files from being spammed:
/gamerule logAdminCommands false
And finally, there's 'sendCommandFeedback' to prevent players that are running commands themselves (such as clicking /tellraw text) from seeing the success output:
Why not just use the selected item tag and a fake attribute ie /testfor @a {SelectedItem:{id:minecraft:golden_sword,Warrior:1}}
"SelectedItem" was not existent at the time this thread was created, and it does fix the issue of detecting the player holding a non-custom item not provided by a command (without needing 9 command blocks). And a small correction: custom item data can only be applied within the "tag" tag, which also wasn't possible at the time the thread was created.
The Meaning of Life, the Universe, and Everything.
Join Date:
8/23/2013
Posts:
140
Location:
New Paltz, NY
Minecraft:
Evcam
Member Details
I'm trying to give players a BackPack score of 1 only when they have a specific item selected, and set it back to 0 when they don't. What command do I use to give a BackPack score of 0 to all players WITHOUT these attributes?
Why bumping this old thread?
Anyway you do /scoreboard players set @a Pack 2 {SelectedItem:....}
Have another:
/scoreboard players remove @a[score_Pack_min=1] Pack 1
So when they have the item selected, their score will be bigger than 0, other will have a score of 0
Rollback Post to RevisionRollBack
Get any of your command blocks problem solved here:
The Meaning of Life, the Universe, and Everything.
Join Date:
8/23/2013
Posts:
140
Location:
New Paltz, NY
Minecraft:
Evcam
Member Details
Won't that also take the score off of players who are already holding the item? I want it only to remove players that aren't. I want a reliable score that will accurately determine whether a payer is holding something, not one that fluctuates.
It will remove the score, but the other one will bump it up to 2 (if they still have backpack) so if they are holding the item, they will always have a score of 2 and get removed 1, so always more than 1, then /execute @a[score_Pack_min=1] ~ ~ ~ /dosomething
Rollback Post to RevisionRollBack
Get any of your command blocks problem solved here:
Nifty usage of the new list-tag changes! In previous versions, you would have to include every single attribute and modifier, which would make such a device unfeasible. With this one, you don't even have to include all of the tags within, so you can just testfor the UUID pair in the modifier and remove the "Operation", "Amount", and "Name" tags (you'll still need to label these tags in your /give), and the "Base" tag from the root attribute:
And of course, your method doesn't actually modify the final outcome of the attribute, so you can have the player wear gear that will affect it, so long as that gear doesn't have the same UUID pair. You can also switch to using just the "Name" tag instead:
/testfor @p {Attributes:[{Name:"Custom Name"}]}]}
And then switching out the value of "Name" in the /give with "Custom Name". Still have to be careful with UUIDs; have had some oddities where the /testfor stops working entirely if I give myself some armor with the same UUID pair and attributes as the sword, but a different "Name". Removing the helmet from my inventory doesn't fix it, nor does a full /clear. The command block itself has to be deleted and replaced in order for it to work again.
It's a shame that most of these /testfor methods doesn't support a multiplayer environment. Once you get the success signal from a /testfor, you won't know which player it had found without a slow and convoluted setup. Personally I should like to see the ability to track attribute "Base" and "Amount" tags via the /scoreboard command, similar to how you can track the players Health/HealF tags with the "health" objective-type. But kudos on the great concept!
EDIT:
/scoreboard can now assign scores based on NBT data, which is needed for multiplayer support:
/scoreboard players set @a OBJECTIVE 1 {Attributes:[{Name:"Custom Name"}]}]}
I dont understand, do you use the display tag when you name the item?
Hey, I am trying to use this to make a magic mirror-type thing from Terraria. It works fine, but if the chunks containing the command blocks have to be loaded for it to work, only being able to use it while I'm at home is kind of pointless. Any way to make this worldwide?
Dear Justin Bieber haters,
I owe my life to Justin.
On March 9th, 2013, I was in a coma for 6 months after a terrible car crash.
One day my nurse turned the radio to Justin’s song.
So I got up, and turned the radio off
"When life gives you lemons, don't make lemonade! Demand to see life's manager! Make life rue the day it thought it could give Cave Johnson lemons! Do you know who I am? I'm the man whose gonna burn your house down - with the lemons! I'm gonna get my engineers to invent a combustible lemon that'll burn your house down!"
So.. I've tried with three different clock setups, none of them worked for me
You're not using the 1.8 snapshots; the upgraded /testfor (the "dataTags" syntax addition) is only available in them. As well, your NBT data is incorrect: the "Inventory" tag has a tag-type of "list", which is defined by square brackets instead of curly. The data that's held within the list are unnamed "compound" tag-types, defined by curly brackets. You're missing the tag-name for the item ID, which is simply "id" (note that this is all case-sensitive):
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/
are there some way I can fix this, hide the command chat or something?
I need the executed commands like /say though to show in the chat.. but I dont need the chat to be spammed by ''found <player>''
Yes, you can modify the gamerule 'commandBlockOutput':
There's also the 'logAdminCommands' gamerule, which prevents log files from being spammed:
And finally, there's 'sendCommandFeedback' to prevent players that are running commands themselves (such as clicking /tellraw text) from seeing the success output:
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 can't thank you enough!!!!
"SelectedItem" was not existent at the time this thread was created, and it does fix the issue of detecting the player holding a non-custom item not provided by a command (without needing 9 command blocks). And a small correction: custom item data can only be applied within the "tag" tag, which also wasn't possible at the time the thread was created.
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/
Anyway you do /scoreboard players set @a Pack 2 {SelectedItem:....}
Have another:
/scoreboard players remove @a[score_Pack_min=1] Pack 1
So when they have the item selected, their score will be bigger than 0, other will have a score of 0
I dont understand, do you use the display tag when you name the item?
Subscribe on YT! Im awesome!
/testfor @p {SelectedItem:{id:"minecraft:diamond_sword",tag:{display:{Name:"Shiney",Lore:[This Sword Shines]}}}}
or
/scoreboard players set @a shine 1 {SelectedItem:{id:"minecraft:diamond_sword",tag:{display:{Name:"Shiney",Lore:[This Sword Shines]}}}}
/scoreboard players set @p (scoreboard) 1 {SelectedItem:{id:mine craft:dirt,tag:{display:{Name:"Name"}}}}
Thanks!
"When life gives you lemons, don't make lemonade! Demand to see life's manager! Make life rue the day it thought it could give Cave Johnson lemons! Do you know who I am? I'm the man whose gonna burn your house down - with the lemons! I'm gonna get my engineers to invent a combustible lemon that'll burn your house down!"
-Cave Johnson