I'm trying to figure out how to make a door open when I kill a mob I've labeled as "The Villain". I have the objective declared, and I have it set to 1, but I can't figure out how to test for this so that the door will open.
I've tried entering into the Command Block with a comparator attached:
"/@p score_name VillainKilled 1"
"/@p score_VillainKilled 1"
"/testfor @p score_name VillainKilled 1"
"/testfor @p score_VillainKilled 1"
"testfor @p score_VillainKilled =1"
And many things in between. I'm sure the variable is equal to 1. Please help me with this. It's the final boss of my adventure map. It's the last thing in the story and I've been working on this around the clock.
You need to use the score name as a search parameter in square brackets, like with coordinates. Try this:
/testfor @p[score_VillainKilled_min=1]
You should use "min" because the normal version is actually maximum bound that would activate if VillainKilled <= 1, which I doubt is your goal. I wouldn't be surprised if this was the cause of your grief - it's got me before too.
The command I listed above goes in the cmd block, and the redstone lamp would actually be your door. I should have just used a door. Well, hopefully you get the point. =]
Thank you, good sir(madam)! Unfortunately, the Villain I was planning to use was a Zombie Pigman equipped with full diamond armor and a diamond sword, but not all Z-pigs can equip such stuff, and it's unreliable. I'll use this sometime, though, and thank you anyway!
just use totalKillCount and that will help example. /testfor [score_kills_min=1] totalkillcount activates when u kill a mob or player and yeah make sure testfor commandblock is on a clock. that should work add the objective with /scoreboard objectives add kills totalKillCount kills
hope this helps
I've tried entering into the Command Block with a comparator attached:
"/@p score_name VillainKilled 1"
"/@p score_VillainKilled 1"
"/testfor @p score_name VillainKilled 1"
"/testfor @p score_VillainKilled 1"
"testfor @p score_VillainKilled =1"
And many things in between. I'm sure the variable is equal to 1. Please help me with this. It's the final boss of my adventure map. It's the last thing in the story and I've been working on this around the clock.
"Gotta blast!" ~Spongebob Squarepants
"Use the Force, Kirk!" ~ Ka D'Argo
/testfor @p[score_VillainKilled_min=1]
You should use "min" because the normal version is actually maximum bound that would activate if VillainKilled <= 1, which I doubt is your goal. I wouldn't be surprised if this was the cause of your grief - it's got me before too.
See for more details:
http://www.minecraft...block#Arguments
Here's an example setup I threw together quick:
The command I listed above goes in the cmd block, and the redstone lamp would actually be your door. I should have just used a door. Well, hopefully you get the point. =]
"Gotta blast!" ~Spongebob Squarepants
"Use the Force, Kirk!" ~ Ka D'Argo
hope this helps
be back later