execute @e[tag=tsLightVal] ~ ~ ~ function mctsts:light/val

function mctsts:light/white
function mctsts:light/red
function mctsts:light/blue
function mctsts:light/green
function mctsts:light/yellow

execute @e[tag=tsLightSource] ~ ~ ~ detect ~ ~ ~ air 0 kill @s

execute @e[tag=tsLightSpawn] ~ ~ ~ summon minecraft:area_effect_cloud ~ ~ ~ {Radius:0.0f,Duration:2147483647,Particle:"take",Tags:["tsLightSource","tsLightVal"]}
execute @e[tag=tsLightSpawn] ~ ~ ~ execute @s[tag=tsLightSpawnRed] ~ ~ ~ scoreboard players tag @e[tag=tsLightVal,c=1] add tsLightRed
execute @e[tag=tsLightSpawn] ~ ~ ~ execute @s[tag=tsLightSpawnRed] ~ ~ ~ setblock ~ ~ ~ red_glazed_terracotta 0
execute @e[tag=tsLightSpawn] ~ ~ ~ execute @s[tag=tsLightSpawnBlue] ~ ~ ~ scoreboard players tag @e[tag=tsLightVal,c=1] add tsLightBlue
execute @e[tag=tsLightSpawn] ~ ~ ~ execute @s[tag=tsLightSpawnBlue] ~ ~ ~ setblock ~ ~ ~ red_glazed_terracotta 1
execute @e[tag=tsLightSpawn] ~ ~ ~ execute @s[tag=tsLightSpawnGreen] ~ ~ ~ scoreboard players tag @e[tag=tsLightVal,c=1] add tsLightGreen
execute @e[tag=tsLightSpawn] ~ ~ ~ execute @s[tag=tsLightSpawnGreen] ~ ~ ~ setblock ~ ~ ~ red_glazed_terracotta 2
execute @e[tag=tsLightSpawn] ~ ~ ~ execute @s[tag=tsLightSpawnYellow] ~ ~ ~ scoreboard players tag @e[tag=tsLightVal,c=1] add tsLightYellow
execute @e[tag=tsLightSpawn] ~ ~ ~ execute @s[tag=tsLightSpawnYellow] ~ ~ ~ setblock ~ ~ ~ red_glazed_terracotta 3
execute @e[tag=tsLightSpawn] ~ ~ ~ execute @s[tag=tsLightSpawnWhite] ~ ~ ~ scoreboard players tag @e[tag=tsLightVal,c=1] add tsLightWhite
execute @e[tag=tsLightSpawn] ~ ~ ~ execute @s[tag=tsLightSpawnWhite] ~ ~ ~ setblock ~ ~ ~ redstone_lamp
execute @e[tag=tsLightSpawn] ~ ~ ~ execute @s[tag=tsLightVal1] ~ ~ ~ scoreboard players tag @e[tag=tsLightVal,c=1] add tsLightVal1
execute @e[tag=tsLightSpawn] ~ ~ ~ execute @s[tag=tsLightVal2] ~ ~ ~ scoreboard players tag @e[tag=tsLightVal,c=1] add tsLightVal2
execute @e[tag=tsLightSpawn] ~ ~ ~ execute @s[tag=tsLightVal3] ~ ~ ~ scoreboard players tag @e[tag=tsLightVal,c=1] add tsLightVal3
execute @e[tag=tsLightSpawn] ~ ~ ~ execute @s[tag=tsLightVal4] ~ ~ ~ scoreboard players tag @e[tag=tsLightVal,c=1] add tsLightVal4
execute @e[tag=tsLightSpawn] ~ ~ ~ execute @s[tag=tsLightVal5] ~ ~ ~ scoreboard players tag @e[tag=tsLightVal,c=1] add tsLightVal5
execute @e[tag=tsLightSpawn] ~ ~ ~ execute @s[tag=tsLightVal6] ~ ~ ~ scoreboard players tag @e[tag=tsLightVal,c=1] add tsLightVal6
execute @e[tag=tsLightSpawn] ~ ~ ~ execute @s[tag=tsLightVal7] ~ ~ ~ scoreboard players tag @e[tag=tsLightVal,c=1] add tsLightVal7
execute @e[tag=tsLightSpawn] ~ ~ ~ execute @s[tag=tsLightVal8] ~ ~ ~ scoreboard players tag @e[tag=tsLightVal,c=1] add tsLightVal8
execute @e[tag=tsLightSpawn] ~ ~ ~ execute @s[tag=tsLightVal9] ~ ~ ~ scoreboard players tag @e[tag=tsLightVal,c=1] add tsLightVal9
execute @e[tag=tsLightSpawn] ~ ~ ~ execute @s[tag=tsLightVal10] ~ ~ ~ scoreboard players tag @e[tag=tsLightVal,c=1] add tsLightVal10
execute @e[tag=tsLightSpawn] ~ ~ ~ execute @s[tag=tsLightVal11] ~ ~ ~ scoreboard players tag @e[tag=tsLightVal,c=1] add tsLightVal11
execute @e[tag=tsLightSpawn] ~ ~ ~ execute @s[tag=tsLightVal12] ~ ~ ~ scoreboard players tag @e[tag=tsLightVal,c=1] add tsLightVal12
execute @e[tag=tsLightSpawn] ~ ~ ~ execute @s[tag=tsLightVal13] ~ ~ ~ scoreboard players tag @e[tag=tsLightVal,c=1] add tsLightVal13
execute @e[tag=tsLightSpawn] ~ ~ ~ execute @s[tag=tsLightVal14] ~ ~ ~ scoreboard players tag @e[tag=tsLightVal,c=1] add tsLightVal14
execute @e[tag=tsLightSpawn] ~ ~ ~ execute @s[tag=tsLightVal15] ~ ~ ~ scoreboard players tag @e[tag=tsLightVal,c=1] add tsLightVal15
execute @e[tag=tsLightSource] ~ ~ ~ entitydata @e[tag=tsLightSpawn] {DeathTime:19s,Health:0.0f}
execute @e[tag=tsLightSource] ~ ~ ~ kill @e[tag=tsLightSpawn]