Elemental Swords

Throw a crafting table + and iron sword on the ground

/summon FallingSand ~ ~1 ~ {Block:stone,Time:1,Passengers:[{id:FallingSand,Block:redstone_block,Time:1,Passengers:[{id:FallingSand,Block:activator_rail,Time:1,Passengers:[{id:MinecartCommandBlock,Command:gamerule commandBlockOutput false},{id:MinecartCommandBlock,Command:"fill ~2 ~-3 ~-2 ~8 ~1 ~2 stained_hardened_clay 2 hollow"},[{id:MinecartCommandBlock,Command:scoreboard objectives add hurt1 dummy},{id:MinecartCommandBlock,Command:"fill ~2 ~-2 ~-2 ~8 ~ ~2 stained_glass 7 replace stained_hardened_clay"},{id:MinecartCommandBlock,Command:"/scoreboard objectives add redtimer dummy"},{id:MinecartCommandBlock,Command:"/scoreboard objectives add sword dummy"},{id:MinecartCommandBlock,Command:"/scoreboard objectives add hurt dummy"},{id:MinecartCommandBlock,Command:"/scoreboard objectives add hurt stat.damageDealt"},{id:MinecartCommandBlock,Command:"/scoreboard objectives add reset dummy"},{id:MinecartCommandBlock,Command:setblock ~1 ~-1 ~ wall_sign 4 replace {Text2:"{\\\"text\\\":\\\"Destroy\\\",\\\"color\\\":\\\"dark_red\\\",\\\"bold\\\":true}",Text3:"{\\\"text\\\":\\\"Machine\\\",\\\"color\\\":\\\"dark_red\\\",\\\"bold\\\":true}"}},{id:MinecartCommandBlock,Command:setblock ~7 ~ ~-1 chain_command_block 3 replace {auto:1,Command:"scoreboard players set @a[score_hurt1_min=1] reset 1"}},{id:MinecartCommandBlock,Command:setblock ~6 ~ ~-1 chain_command_block 5 replace {auto:1,Command:"scoreboard players set @a[score_hurt_min=1] reset 1"}},{id:MinecartCommandBlock,Command:setblock ~5 ~ ~-1 chain_command_block 5 replace {auto:1,Command:"scoreboard players set @a[score_reset_min=1] reset 0"}},{id:MinecartCommandBlock,Command:setblock ~4 ~ ~-1 chain_command_block 5 replace {auto:1,Command:"scoreboard players set @a[score_reset_min=1] hurt 0"}},{id:MinecartCommandBlock,Command:setblock ~3 ~ ~-1 chain_command_block 5 replace {auto:1,Command:"scoreboard players set @a[score_reset_min=1] hurt1 0"}},{id:MinecartCommandBlock,Command:setblock ~3 ~-1 ~-1 chain_command_block 1 replace {auto:1,Command:"execute @e[score_sword_min=5,score_sword=5,score_hurt_min=1] ~ ~ ~ execute @e[score_hurt1_min=1,r=6] ~ ~ ~ setblock ~ ~ ~ fire"}},{id:MinecartCommandBlock,Command:setblock ~4 ~-1 ~-1 chain_command_block 4 replace {auto:1,Command:"scoreboard players set @a sword 5 {SelectedItem:{id:\\\"minecraft:diamond_sword\\\",tag:{F:1}}}"}},{id:MinecartCommandBlock,Command:setblock ~5 ~-1 ~-1 chain_command_block 4 replace {auto:1,Command:"execute @e[score_sword_min=4,score_sword=4,score_hurt_min=1] ~ ~ ~ execute @e[score_hurt1_min=1,r=6] ~ ~ ~ summon LightningBolt"}},{id:MinecartCommandBlock,Command:setblock ~6 ~-1 ~-1 chain_command_block 4 replace {auto:1,Command:"scoreboard players set @a sword 4 {SelectedItem:{id:\\\"minecraft:diamond_sword\\\",tag:{L:1}}}"}},{id:MinecartCommandBlock,Command:setblock ~7 ~-1 ~-1 chain_command_block 4 replace {auto:1,Command:"effect @a[score_droplet_min=1] weakness 1 100 true"}},{id:MinecartCommandBlock,Command:setblock ~7 ~-1 ~ chain_command_block 2 replace {auto:1,Command:"scoreboard players remove @e[score_droplet_min=1] droplet 1"}},{id:MinecartCommandBlock,Command:setblock ~6 ~-1 ~ chain_command_block 5 replace {auto:1,Command:"execute @e[score_droplet_min=1] ~ ~ ~ /particle droplet ~ ~ ~ .2 0 .2 0 300 force"}},{id:MinecartCommandBlock,Command:setblock ~5 ~-1 ~ chain_command_block 5 replace {auto:1,Command:"execute @e[score_sword_min=3,score_sword=3,score_hurt_min=1] ~ ~ ~ scoreboard players set @e[score_hurt1_min=1,r=4] droplet 30"}},{id:MinecartCommandBlock,Command:setblock ~4 ~-1 ~ chain_command_block 5 replace {auto:1,Command:"scoreboard players set @e hurt1 1 {HurtTime:9s}"}},{id:MinecartCommandBlock,Command:setblock ~3 ~-1 ~ chain_command_block 5 replace {auto:1,Command:"scoreboard players set @a sword 3 {SelectedItem:{id:\\\"minecraft:diamond_sword\\\",tag:{W:1}}}"}},{id:MinecartCommandBlock,Command:setblock ~3 ~-1 ~1 chain_command_block 2 replace {auto:1,Command:"execute @a[score_sword_min=1,score_sword=1,rx=90,rxm=70] ~ ~ ~ detect ~ ~-.1 ~ air 0 effect @p levitation 1 250 true"}},{id:MinecartCommandBlock,Command:setblock ~4 ~-1 ~1 chain_command_block 4 replace {auto:1,Command:"effect @a[score_sword_min=1,score_sword=1,rxm=-70,rx=90] levitation 0"}},{id:MinecartCommandBlock,Command:setblock ~5 ~-1 ~1 chain_command_block 4 replace {auto:1,Command:"effect @a[score_sword_min=1,score_sword=1,rxm=-90,rx=-70] levitation 2 3 true"}},{id:MinecartCommandBlock,Command:setblock ~6 ~-1 ~1 chain_command_block 4 replace {auto:1,Command:"scoreboard players set @a[score_redtimer_min=100] redtimer 0"}},{id:MinecartCommandBlock,Command:setblock ~7 ~-1 ~1 chain_command_block 4 replace {auto:1,Command:"clear @a[score_redtimer_min=100] redstone 0 1"}},{id:MinecartCommandBlock,Command:setblock ~7 ~-2 ~1 chain_command_block 1 replace {auto:1,Command:"effect @a[score_redtimer_min=100] 16 14 2 true"}},{id:MinecartCommandBlock,Command:setblock ~6 ~-2 ~1 chain_command_block 5 replace {auto:1,Command:"effect @a[score_redtimer_min=100] 8 5 2 true"}},{id:MinecartCommandBlock,Command:setblock ~5 ~-2 ~1 chain_command_block 5 replace {auto:1,Command:"effect @a[score_redtimer_min=100] 5 5 1 true"}},{id:MinecartCommandBlock,Command:setblock ~4 ~-2 ~1 chain_command_block 5 replace {auto:1,Command:"scoreboard players add @a redtimer 1 {SelectedItem:{id:\\\"minecraft:diamond_sword\\\",tag:{R:1}},Inventory:[{id:\\\"minecraft:redstone\\\"}]}"}},{id:MinecartCommandBlock,Command:setblock ~3 ~-2 ~1 chain_command_block 5 replace {auto:1,Command:"scoreboard players set @a sword 2 {SelectedItem:{id:\\\"minecraft:diamond_sword\\\",tag:{R:1}},Inventory:[{id:\\\"minecraft:redstone\\\"}]}"}},{id:MinecartCommandBlock,Command:setblock ~3 ~-2 ~ chain_command_block 3 replace {auto:1,Command:"scoreboard players set @a sword 1 {SelectedItem:{id:\\\"minecraft:diamond_sword\\\",tag:{A:1}}}"}},{id:MinecartCommandBlock,Command:setblock ~4 ~-2 ~ chain_command_block 4 replace {auto:1,Command:"scoreboard players set @a[score_sword_min=1] sword 0"}},{id:MinecartCommandBlock,Command:setblock ~5 ~-2 ~ chain_command_block 4 replace {auto:1,Command:"execute @e[name=SwordCrafting] ~ ~1 ~ particle magicCrit ~ ~ ~ .15 0 .15 0 1 force"}},{id:MinecartCommandBlock,Command:setblock ~6 ~-2 ~ chain_command_block 4 replace {auto:1,Command:"execute @e[name=SwordsCrafting] ~ ~ ~ entitydata @e[c=1] {CustomName:SwordCrafting}"}},{id:MinecartCommandBlock,Command:setblock ~7 ~-2 ~ chain_command_block 4 replace {auto:1,Command:"execute @e[name=SwordsCrafting] ~ ~ ~ effect @e[c=1] 14 10000 10 true"}},{id:MinecartCommandBlock,Command:setblock ~7 ~-2 ~-1 chain_command_block 3 replace {auto:1,Command:"execute @e[name=SwordsCrafting] ~ ~ ~ setblock ~ ~ ~ log2 13"}},{id:MinecartCommandBlock,Command:setblock ~6 ~-2 ~-1 chain_command_block 5 replace {auto:1,Command:"execute @e[type=Item,score_sword_min=1,score_sword=1] ~ ~ ~ execute @e[type=Item,score_sword_min=2,score_sword=2,r=1] ~ ~ ~ kill @e[type=Item,r=1,score_sword_min=1,score_sword=2]"}},{id:MinecartCommandBlock,Command:setblock ~5 ~-2 ~-1 chain_command_block 5 replace {auto:1,Command:"execute @e[type=Item,score_sword_min=1,score_sword=1] ~ ~ ~ execute @e[type=Item,score_sword_min=2,score_sword=2,r=1] ~ ~ ~ summon Item ~ ~ ~ {Item:{id:\\\"spawn_egg\\\",Count:1b,tag:{display:{Name:Swords Crafting},ench:[],EntityTag:{id:\\\"Villager\\\",CustomName:\\\"SwordsCrafting\\\",CustomNameVisible:1,Profession:0,Offers:{Recipes:[{rewardExp:0b,maxUses:2147483647,uses:0,buy:{id:prismarine_crystals,Count:1},buyB:{id:gold_ingot,Count:1},sell:{id:prismarine_crystals,Count:1,tag:{ench:[],display:{Name:\\\"Lightning Shard\\\"}}}},{rewardExp:0b,maxUses:2147483647,uses:0,buy:{id:prismarine_crystals,Count:16,tag:{ench:[],display:{Name:\\\"Lightning Shard\\\"}}},buyB:{id:diamond_sword,Count:1},sell:{id:diamond_sword,Count:1,tag:{ench:[],L:1,display:{Name:\\\"Lightning Sword\\\"}}}},{rewardExp:0b,maxUses:2147483647,uses:0,buy:{id:fire_charge,Count:64},buyB:{id:diamond_sword,Count:1},sell:{id:diamond_sword,Count:1,tag:{ench:[],F:1,display:{Name:\\\"Fire Sword\\\"},ench:[{id:20,lvl:1}]}}},{rewardExp:0b,maxUses:2147483647,uses:0,buy:{id:redstone,Count:64},buyB:{id:diamond_sword,Count:1},sell:{id:diamond_sword,Count:1,tag:{ench:[],R:1,display:{Name:\\\"Redstone Sword\\\"}}}},{rewardExp:0b,maxUses:2147483647,uses:0,buy:{id:packed_ice,Count:16},buyB:{id:diamond_sword,Count:1},sell:{id:diamond_sword,Count:1,tag:{ench:[],I:1,display:{Name:\\\"Ice Sword\\\"}}}},{rewardExp:0b,maxUses:2147483647,uses:0,buy:{id:potion,Count:1,tag:{Potion:\\\"minecraft:long_water_breathing\\\"}},buyB:{id:diamond_sword,Count:1},sell:{id:diamond_sword,Count:1,tag:{W:1,ench:[],display:{Name:\\\"Water Sword\\\"},ench:[{id:19,lvl:4}]}}},{rewardExp:0b,maxUses:2147483647,uses:0,buy:{id:nether_star,Count:1},buyB:{id:diamond_sword,Count:1},sell:{id:diamond_sword,Count:1,tag:{ench:[],A:1,display:{Name:\\\"Air Sword\\\"},AttributeModifiers:[{AttributeName:\\\"generic.movementSpeed\\\",Name:\\\"generic.movementSpeed\\\",Amount:+.6,Operation:2,UUIDLeast:841564,UUIDMost:436906,Slot:\\\"mainhand\\\"},{AttributeName:\\\"generic.attackDamage\\\",Name:\\\"generic.attackDamage\\\",Amount:+4,Operation:0,UUIDLeast:627012,UUIDMost:910392,Slot:\\\"mainhand\\\"},{AttributeName:\\\"generic.attackSpeed\\\",Name:\\\"generic.attackSpeed\\\",Amount:+3.2,Operation:0,UUIDLeast:520022,UUIDMost:997601,Slot:\\\"mainhand\\\"}],ench:[{id:19,lvl:2}]}}},{rewardExp:0b,maxUses:2147483647,uses:0,buy:{id:stonebrick,Damage:3,Count:16},buyB:{id:diamond_sword,Count:1},sell:{id:diamond_sword,Count:1,tag:{E:1,ench:[],AttributeModifiers:[{AttributeName:\\\"generic.movementSpeed\\\",Name:\\\"generic.movementSpeed\\\",Amount:-.3,Operation:2,UUIDLeast:841564,UUIDMost:436906,Slot:\\\"mainhand\\\"},{AttributeName:\\\"generic.attackDamage\\\",Name:\\\"generic.attackDamage\\\",Amount:7,Operation:0,UUIDLeast:627012,UUIDMost:910392,Slot:\\\"mainhand\\\"},{AttributeName:\\\"generic.armor\\\",Name:\\\"generic.armor\\\",Amount:+10,Operation:0,UUIDLeast:416414,UUIDMost:165193,Slot:\\\"mainhand\\\"},{AttributeName:\\\"generic.attackSpeed\\\",Name:\\\"generic.attackSpeed\\\",Amount:1.6,Operation:0,UUIDLeast:520022,UUIDMost:997601,Slot:\\\"mainhand\\\"}],display:{Name:\\\"Earth Sword\\\"}}}}]},Invulnerable:1,NoAI:1,Silent:1}}}}"}},{id:MinecartCommandBlock,Command:setblock ~4 ~-2 ~-1 chain_command_block 5 replace {auto:1,Command:"scoreboard players set @e[type=Item] sword 2 {Item:{id:\\\"minecraft:iron_sword\\\",Damage:0s},OnGround:1b}"}},{id:MinecartCommandBlock,Command:setblock ~3 ~-2 ~-1 repeating_command_block 5 replace {auto:1,Command:"scoreboard players set @e[type=Item] sword 1 {Item:{id:\\\"minecraft:crafting_table\\\"},OnGround:1b}"}},{id:MinecartCommandBlock,Command:setblock ~ ~ ~1 command_block 0 replace {Command:fill ~ ~-3 ~-1 ~ ~ ~ air}},{id:MinecartCommandBlock,Command:setblock ~ ~-1 ~1 redstone_block},{id:MinecartCommandBlock,Command:kill @e[type=MinecartCommandBlock,r=1]}]}]}]}