4

I am working on a map with a boss fight where a witch is the boss. During the boss fight, I need different mobs to spawn on the ground based on which potion the witch threw (slowness, poison, weakness, or damage).

Using the testfor command, I have tried: /testfor @e[type=ThrownPotion] {Potion:{id:potion,Damage:16388}} and I have connected a comparator output from the command block. Yes, the command block is on a clock.

When I throw the Poison Splash Potion (0:33), the command block says the potion did not have the required data structure.

Is there something wrong with the command? Is there something wrong with the ThrownPotion? Is there a possible way to do this?

Thanks

3
  • Irrevelant: Wow! I remember you, TBNRfrags played your map!
    – Who
    Commented Nov 8, 2015 at 5:51
  • @PanV can you send me a link to the video where he played my map? I cannot seem to locate it and I would appreciate it very much. You can send it to me on my YT or just reply to this comment. Thanks! Commented Nov 28, 2015 at 3:48
  • Sowy, I cannot do that... ;.; I don't remember. I just heard about you, I didn't see it in a vid.
    – Who
    Commented Dec 4, 2015 at 7:59

1 Answer 1

4

When testing for pre-existing data, you must declare the data as-is. The item ID is saved with a namespace, defaulting to minecraft, but your input via /testfor (or /scoreboard) will not be automatically corrected. As such, you must input the namespace that the item is saved with, becoming minecraft:potion.

The Damage tag is saved with a tag-type of Short. In order to declare a Short, you must append the numerical value with an 's'.

Your command will become:

/testfor @e[type=ThrownPotion] {Potion:{id:"minecraft:potion",Damage:16388s}}
1
  • Thanks Skylinerw! I can't believe it was that simple. Btw I was already subscribed to your YT before I asked this question Commented Nov 8, 2015 at 5:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .