21 - 40 of 47
execute
's detect
syntax to increment a score while a player is inside the portal. Set up the objective:/scoreboard objectives add portalTimer dummy
/scoreboard objectives remove @a[score_portalTimer_min=1] portalTimer 1
/execute @a ~ ~ ~ detect ~ ~ ~ minecraft:portal -1 /scoreboard objectives add @a[c=1] portalTimer 2
/tp @a[x=<x1>,y=<y1>,z=<z1>,r=10,score_portalTimer_min=60] <x2> <y2> <z2>
/tp @a[x=<x2>,y=<y2>,z=<z2>,r=10,score_portalTimer_min=60] <x1> <y1> <z1>
/scoreboard players set @a[score_portalTimer_min=60] portalTimer 0
portalTimer
by one for every tick for all players within the portal, and decrease it by one for players outside a portal (to a minimum of 0).<x1> <y1> <z1>
and <x2> <y2> <z2>
with coordinates just outside (!) of the first and second portals.21 - 40 of 47
© 2010 - 2024
www.planetminecraft.com