2

I've been doing some research on making lightning swords or items, but the only working things seem to be server plugins. I'm trying to achieve the same effect with command blocks in Minecraft 1.8.8.

There probably is a way using scoreboard, execute and summon commands. The thing I'm trying, however, is to make the lightningBolt entity spawn where I click. Does anyone know how to do this?

  • 2
    i'm pretty sure you can't do exactly where you are clicking, as there is no way to detect it using command blocks, but you can do it relative to entities that you aim at. For this, i suggest looking here – Judge2020 Aug 20 '15 at 14:59
  • 1
    Not possible AFAIK although I'm pretty sure you could use named arrows & a bow using something like /execute @e[type=Arrow] summon LightningBolt (although those aren't the correct entity names). This will also summon lightning until the arrow despawns (i.e. never if fired by a player) so you'd need to work out how to kill the arrow. – user109232 Aug 20 '15 at 19:19
  • 1
    Maybe every tick add 1 to a fired arrow's dummy scoreboard objective, then kill all arrows with score > 2? You'd need to only detect arrows stuck in the ground (there's an NBT tag IIRC, similarly with the name assuming you don't want all arrows to summon lightning). – user109232 Aug 20 '15 at 19:22
  • I thought it was impossible to add a datatag to the execute command? Could you tell me how to do so? Also, the bow idea sounds great! – Jaïr Paalman Aug 20 '15 at 20:45
  • @JaïrPaalman You can't directly add a datatag to an execute command, but you can set a scoreboard objective based on a datatag, and then use that score in the execute selector. – SirBenet Aug 22 '15 at 15:30
1

You can create a lightning stick using these commands in a command block:

/testfor @e[type=Player] {SelectedItemSlot:0}

/execute @e[type=*InsertMobNameHere*] ~ ~ ~ summon LightningBolt ~ ~ ~

You can also create lightning arrows:

/execute @e[type=Arrow,c11] ~ ~ ~ summon LightningBolt

/kill @e[type=Arrow]

To receive a command block, you can type in the command chat:

/give @p minecraft:command_block 64
  • Thank you, but I,m no longer interested in making a lightning sword because I already had someone help me with a lightning bow. It works a little more accurate, only summoning lightning if the arrows are in the ground. Anyways, thanks. – Jaïr Paalman Sep 29 '15 at 5:09
0

Just use a few one is enchant (your name) (whatever enchantment you want) 1 then put a comparator then put a command block that says execute @a ~ ~ ~ tp @e[type=lightning_bolt] ^ ^ ^10 then put another that says summon lightning_bolt and put all of them to repeat IT IS POSSABLE

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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