We've split up the commands, scripting and mods, and add ons category! Please be sure you get your thread in the right place.

5

/playerswap command

2 Comments

Please sign in to leave a comment.

Sorted by oldest
  • 0
    Registered User commented
    Comment actions Permalink

    This would be very fun and you can make little mini games 

     

  • 0
    Registered User commented
    Comment actions Permalink

    I assume you mean swapping two players' positions, in which case this is already possible.

    Just tag two players Player1 and Player2, summon an armour stand at player 1 with a tag, teleport player 1 to player 2, and teleport player 2 to the armour stand:

    tag @r add Player1
    tag @r[tag=!Player1] add Player2
    execute @a[c=1,tag=Player1] ~ ~ ~ summon armor_stand ~ ~ ~
    execute @a[c=1,tag=Player1] ~ ~ ~ tag @e[type=armor_stand,r=1] add swapHelp
    tp @a[tag=Player1] @a[c=1,tag=Player2]
    tp @a[tag=Player2] @e[c=1,tag=swapHelp]
    kill @e[tag=swapHelp]

    Java Edition is easier:

    tag @r add Player1
    tag @r[tag=!Player1] add Player2
    execute at @a[tag=Player1] run summon armor_stand ~ ~ ~ {Tags:["swapHelp"]}
    tp @a[tag=Player1] @a[limit=1,tag=Player2]
    tp @a[tag=Player2] @e[limit=1,tag=swapHelp]
    kill @e[tag=swapHelp]