RandomTeleporter

RandomTeleporter

Mod

Added two commands for random teleportation

Server Utility

155 downloads
1 follower
Created7 months ago
Updated17 days ago

Follow Save
Host your Minecraft server on BisectHosting - get 25% off your first month with code MODRINTH.

Tip: This description has been translated from the Chinese source text using DeepL, if necessary, it is recommended to view the source text.
如果你能看懂这段文字,那么我建议你点下面这个链接,去Github看用中文写的模组介绍。
Chinese source text hosted on Github
如果你的网络环境无法稳定访问Github,那你可以试试下面这个链接,这是我自己部署的Gitea服务器上创建的镜像仓库
Gitea mirror

Introduction

This mod adds a command (/rtp) to randomly teleport the player to any location in the world.

Command Format

  • /rtp
  • /rtp <Radius>
  • /rtp <PlayerID>
  • /rtp <Radius> <PlayerID>
  • /rtp <PlayerID> <Radius>
  • /rtp <Radius> <OriginPos(RandomCentre, Coordinates)>
  • /rtp <Radius> <TransportedPlayerID> <OriginEntity(RandomCentre, Entity)>
  • /rtp <Radius> <TransportedPlayerID)> <OriginPos(RandomCentre, Coordinate)>
  • /rtp <PlayerID> <Radius> <OriginEntity(RandomCentre, Entity)>
  • /rtp <PlayerID> <Radius> <OriginPos(RandomCentre, Coordinate)>

Command example

  • /rtp
    Randomly teleport the player who executes the command to a random point within a random radius of 2.9e7 - 1e4, with (0,0) as the centre.
    2.9e+7 = 2.9 x 10^7 = 29000000 = twenty-nine million
    1e4 = 10^4 = 10000 = ten thousand

  • /rtp 1000
    Randomly teleports the player executing the command to a random point centred at (0,0) with a random radius of 1000.

  • /rtp TheWhiteDog9487
    Sends TheWhiteDog9487 to a random point within a random radius of 2.9e7 - 1e4, centred at (0,0).

  • /rtp TheWhiteDog9487 1000
    Send TheWhiteDog9487 to a random point centred at (0,0) with a random radius of 1000.

  • /rtp 1000 TheWhiteDog9487
    Send TheWhiteDog9487 to a random point centred at (0,0) with a random radius of 1000.

  • /rtp 1000 10000 ~ 10000
    Randomly sends the player executing the command to a random point centred at (10000,10000) with a random radius of 1000.
    Tip: According to the reason, the centre coordinate doesn't need height (Y-axis), but since the type of the coordinate is Vec3d, you still need to write the height.
    As for the specific value of the height, feel free to write it, it's not used in the code.

  • /rtp 1000 TheWhiteDog9487 TheWhiteDog_CN
    Sends TheWhiteDog9487 to a random point within a random radius of 1000 from the centre of TheWhiteDog_CN's location.

  • /rtp 1000 TheWhiteDog9487 10000 ~ 10000
    Send TheWhiteDog9487 to a random point centred at (10000,10000) with a random radius of 1000.

  • /rtp TheWhiteDog9487 1000 TheWhiteDog_CN
    Send TheWhiteDog9487 to a random point within a random radius of 1000, centred on TheWhiteDog_CN.

  • /rtp TheWhiteDog9487 1000 10000 ~ 10000
    Sends TheWhiteDog9487 to a random point centred on (10000,10000) with a random radius of 1000.

Special note

/rtp <Radius> <Origin> This format does not exist.
This is because the second parameter could be the name of the player being teleported, or it could be the entity doing the random centre point.
Both are entity types, and there is no way to tell which one is which, and there is ambiguity.

dependencies

Since I'm using CommandRegistrationCallback.EVENT in fabric.api.command.v2 to register commands with the game, this mod needs to rely on the Fabric API

About player permissions

I referenced the vanilla /tp command and set a level 2 permission requirement for /rtp.
If it's vanilla or vanilla-like, you only need to give the player permission to cheat for it to work.
The plugin server side of those specific permission assignments, since I haven't played it myself so I can't give a reference.

Installed on client or server?

There are the following scenarios:

  1. single player
    1. the physical server does not exist, so the server is not important.
    2. Client-side installation is sufficient
  2. Single player + Open LAN
    1. use the built-in server of the client, the client of the player in the open LAN needs to be installed.
    2. other players who join the game do not need to install it
  3. use a standalone server (similar to server.jar file)
    1. server needs to be installed
    2. the client does not need to be installed

Project members

TheWhiteDog9487

Owner


Technical information

License
WTFPL
Client side
unsupported
Server side
required
Project ID