Commands to run once:
give @p torch 1 0 {HideFlags:1,isFlashlight:1,display:{Name:"Flashlight"},ench:[{id:0,lvl:1}]}
COLUMN
execute @a[tag=flashlightON] ~ ~ ~ fill ~ ~4 ~ ~ ~4 ~ end_portal 0 keep
execute @a ~ ~ ~ fill ~3 ~2 ~3 ~-3 ~6 ~-3 air 0 replace end_portal
scoreboard players tag @a add flashlightON {Inventory:[{Slot:-106b,id:minecraft:torch,tag:{isFlashlight:1}}]}
scoreboard players tag @a add flashlightON {SelectedItem:{id:minecraft:torch,tag:{isFlashlight:1}}}
/scoreboard players tag @a remove flashlightON
How it works:
See what's inside of each command block!
© Cimap. All Rights Reserved
This website is not endorsed, associated or affiliated with Mojang AB.