-1

So I'm trying to make a command where you throw a snowball and a trail of lighting bolts follows it.

Heres the command:

/testfor @e[type=snowball]

With a comparator facing into this one,

/execute @e[type=snowball] ~ ~ ~ /summon lightning ~ ~1 ~

When I throw the snowball, it says:

Failed to execute '/summon lightning ~ ~1 ~' as Snowball

Why?

0

1 Answer 1

1

A look over at the entity IDs wiki shows that the proper entity ID for lightning is lightning_bolt.

You no longer need to use comparators out of command blocks to execute a second command block. You can now use chained execution. Face the first block at a second command block. Set the second command block to Chain Conditional. If the first command block executes successfully, the second command block will be executed.

In this case, you do not need to do that. You can skip the testfor command entirely. Only use the execute command in a repeating command block. It will not execute unless a snowball is found.

This command functions properly:

execute @e[type=snowball] ~ ~ ~ summon lightning_bolt ~ ~1 ~

Image

7
  • I'm a little confused I did what you said and the test for command found the snowball but it's not activating the the chain conditional execute command block to summon lightning.
    – luca
    Commented Jun 16, 2018 at 15:25
  • Just to make sure I'm doing everything right, the first command is,
    – luca
    Commented Jun 16, 2018 at 15:26
  • /testfor @e[type=snowball]
    – luca
    Commented Jun 16, 2018 at 15:26
  • And that is repeat and always active facing into,
    – luca
    Commented Jun 16, 2018 at 15:27
  • /execute @e[type=snowball] ~ ~ ~ /summon lightning_bolt
    – luca
    Commented Jun 16, 2018 at 15:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.