TPA (Teleport Request) System

Learn how to create a complete TPA system with Request, Accept, and Deny functionality!

What is TPA?

A Teleport Request system allows players to request teleportation to other players with an accept/deny mechanism.

Setup Instructions

Step 1: Define Syntax Patterns

Edit config/CommandMaker/syntax.json:

{
  "tpa": {
    "pattern": "/tpa <player>",
    "description": "Send teleport request"
  },
  "tpaccept": {
    "pattern": "/tpaccept <player>",
    "description": "Accept teleport request"
  },
  "tpadeny": {
    "pattern": "/tpadeny <player>",
    "description": "Deny teleport request"
  }
}

Step 2: Create Aliases

Edit config/CommandMaker/aliases.json:

{
  "tpa": "tellraw ${tpa_player} {\"text\":\"${player} wants to teleport to you! Type /tpaccept ${player} or /tpadeny ${player}\",\"color\":\"yellow\"}",
  "tpaccept": "execute as ${tpaccept_player} at @s run tp ${player} @s",
  "tpadeny": "tellraw ${tpadeny_player} {\"text\":\"Teleport request from ${player} denied.\",\"color\":\"red\"}"
}

Step 3: Reload

In-game, run:

/addcommand reload

Usage Example

Player A requests TP to Player B:

/tpa B

→ Player B receives: "A wants to teleport to you! Type /tpaccept A or /tpadeny A"

Player B accepts:

/tpaccept A

→ Player A is teleported to Player B

Or Player B denies:

/tpadeny A

→ Player A receives: "Teleport request from B denied."

Advanced Variations

With Delay

{
  "tpa": "schedule function my_namespace:tpa_delay 5t"
}

With Confirmation Sound

{
  "tpaccept": "playsound entity.player.teleport neutral @s && execute as ${tpaccept_player} at @s run tp ${player} @s"
}

With Toast Notification

{
  "tpa": "tellraw ${tpa_player} {\"text\":\"${player} sent TPA\",\"color\":\"yellow\"} && playsound ui.button.click master ${tpa_player}"
}

💡 Pro Tip

Use JSON formatting in the tellraw command for colored messages and better formatting!

Customization Ideas