SmarterRandomTP

SmarterRandomTP

934 Downloads

*** Due to unwise and scummy decisions by Curse, my Bukkit Dev account will be inaccessible starting March 1st, 2018. Thus, I can no longer update any of my plugins here on the Bukkit Dev site. Please find the new repo for this plugin at the excellent SpigotMC site: https://www.spigotmc.org/resources/smarterrandomtp.53322/ ***

What is it?

SmarterRandomTP is a plugin that provides a smarter way to do random teleports. With SRTP, you wont be dumped in lava, fire, off a cliff, or so far underwater that you drown, among other unfortunate destinations.

------------------------

Built for CraftBukkit/Spigot 1.12.X. It should be compatible with all 1.8+ versions.

------------------------

Setup

  • Download the JAR to your plugins directory. Self explanatory for GUIs. For those using an Ubuntu/Debian terminal, use "wget jarurl" with the url to the jar file (go to the Files tab) in quotes. If you don't have access to the terminal the host is managing, you can try to use an FTP program to connect via SFTP and upload the jar file.
  • PLEASE SCROLL DOWN THE BOTTOM OF THIS POST FOR THE DEFAULT CONFIG! SPIGOT IS KNOWN TO WIPE THE COMMENTS IN THE AUTOMATICALLY-DEPLOYED DEFAULT CONFIG FILE!

Configuration

  • Only one USER-EDITABLE file in the data folder: config.yml
  • All the variables in the config are explained via comments
  • Valuetypes for config variables are indicated via comments
  • This plugin will generate a savedata.yml file that stores cooldown values. Do not modify this file! If you wish to reset everyone's cooldown, simply delete the file.


Commands/How to Use

Command Description Permission
/rtp Performs a random teleport using the configuration parameters smarterrandomtp.rtp
/rtpReload Reloads the configuration in memory from the config.yml file smarterrandomtp.reload

/rtpSetRadiusX <positive-integer>

Set the radius in the X direction for which a randomtp may be placed

smarterrandomtp.setRadiusX

/rtpSetRadiusZ <positive-integer>

Set the radius in the Z direction for which a randomtp may be placed

smarterrandomtp.setRadiusZ

/rtpSetRangeY <lower-bound-as-positive-integer> <upper-bound-as-positive-integer>

Set the range in the Y direction for which a randomtp may be placed

smarterrandomtp.setRangeY

/rtpSafeTeleport <boolean>

When enabled, teleports will be 99% free of hazards

smarterrandomtp.setSafeTeleport

/rtpSetOriginX <integer>

Set the X position of the randomtp origin smarterrandomtp.setOriginX

/rtpSetOriginZ <integer>

Set the Z position of the randomtp origin

smarterrandomtp.setOriginZ

/rtpSetCooldown <milliseconds-as-a-positive-long>

Set the cooldown period (in milliseconds)

smarterrandomtp.setCooldown

/rtpSetCooldownVIP <milliseconds-as-a-positive-long>

Set the VIP cooldown period (in milliseconds)

smarterrandomtp.setCooldownVIP

/rtpOnPlayer <victim-player-name>

Cause the specified player to undergo a random teleport

smarterrandomtp.rtpOnPlayer

/rtpSetWaterSafe <boolean>

Sets whether or not SRTP can teleport a player into water

smarterrandomtp.setWaterSafe

/rtpReportConfig

Reports the current SRTP configuration

smarterrandomtp.reportConfig

 
With the exception of /rtp, all commands are OP-only by default.
You can use tab to autocomplete player names for /rtpOnPlayer


Cooldown Usage:

This plugin has two different cooldown periods to benefit servers with user perks. First, simply set cooldown and cooldownVIP in the config file to the values you desire.

The default cooldown period is applied to all players. To give a user or group access to the VIP cooldown period instead, give them the following permission: smarterrandomtp.useVIPCooldown

By default, only OPs have the smarterrandomtp.useVIPCooldown permission.

Default Config

# Please note that using the ingame commands to adjust these values will also affect this file in realtime!
# That is, if you use "/cooldown 3000", the plugin loaded in memory will update with the new value and this config file will be immediately overwritten with the new value of 3000 as well

# NOTE: If you use ingame commands to change settings, all these nice comments will be deleted from this file! That is just how Bukkit works unfortunately

# ----------------------------------------
# Safe teleport flag. If true, using /rtp try to find a safe destination. The criteria for a safe destination are:
# > 3x3x3 region of air or water surrounding the player
# > The landing block is not lava, fire, magma, cactus, or portals
# > The landing block is no further than 5 blocks of air below the player
# > The landing block is no more than 12 blocks underwater to alleviate drowning

# Set to true/false

safeTeleport: true

# ----------------------------------------

# ----------------------------------------
# Water safety consideration
# If true, water is allowed as a teleport destination. If false, players will not be teleported into water. Useful to toggle if your players lag when rtp'd into an ocean and tend to drown due to said lag.

# Set to true/false

waterIsConsideredSafe: true

# ----------------------------------------

# ----------------------------------------
# Teleport range information
# This is how far from the origin point the teleport destination can be. The X and Z radii are self explanatory. The Y range is an absolute range.

# The following values are all integers

radiusX: 3000
radiusZ: 3000
rangeYLower: 50
rangeYUpper: 110

# ----------------------------------------

# ----------------------------------------
# Teleport origin information
# This should likely be the position of your spawn or server entrance. The radius for the random teleport is applied to this origin point.

# The following values are all integers

originX: 0
originZ: 0

# ----------------------------------------

# ----------------------------------------
# Cooldowns - you can set cooldowns for /rtp so as to prevent abuse or create perks
# The units is milliseconds. A value of 0 means no cooldown.
# Reference: 1 second is 1000ms. 1 minute is 60000ms. 1 hour is 3600000ms. 1 day is 86400000ms.

# The following values are all longs (int64)

cooldown: 60000
cooldownVIP: 5000

# ----------------------------------------