M HYPE SPLASH
// news

How does one make a lightning sword in vanilla Minecraft?

By Emma Payne

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?

6

3 Answers

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
2

Late to the party, but you can use this./execute at [player] run summon minecraft:lightning_bolt ~ ~ ~Summons summons lightning bolt at player position. ~ ~ ~ is needed. You can also use @r, @a and others in place of [player]. Apparently you need the at part before the run part.

1

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