Teleport to a random location with just only one command.
This plugin was developed by SergiFerry
/randomtp (world) - Teleports you to a random location.
- You can modify this command on config.yml
- You also need to set "command-all-worlds" as true, to RandomTP to another world with the command.
- Permission: randomtp.use.command
/rtpreload - Reloads RandomTP config.
- Permission: randomtp.reload
You can also create clickable signs like this:
You can also create clickable NPCs like this:
/rtpnpc create (world) [personal/group]
- Permission: randomtp.create.npc
With PlayerNPC dependency
randomtp.* - Only just for admins.
randomtp.use - Let players use the RandomTP.
randomtp.cooldown.bypass - No cooldown for RandomTP (possible VIP feature)
PlayerNPC API
https://www.spigotmc.org/resources/playernpc.93625/
Vault (Economy)
https://www.spigotmc.org/resources/vault.34315/
Chunky
https://www.spigotmc.org/resources/chunky.81534/
In order to use this dependencies, you must enable it on config.yml
Code (YAML):
# Random Teleport by SergiFerry
# Spigot: https://www.spigotmc.org/resources/randomtp.20063/
#
# Compatible with PlayerNPC API
# Spigot: https://www.spigotmc.org/resources/playernpc.93625/
# With PlayerNPC you will be able to create NPCs to do RandomTP with /createrandomtpnpc (world) (playerSkin)
#
# Compatible with Vault (Economy)
# Spigot: https://www.spigotmc.org/resources/vault.34315/
# Use {price} placeholder on signs and messages.
worlds:
world:
max-x
: 10000
max-z
: 10000
min-x
: -10000
min-z
: -10000
alias
: '&a&lWorld'
prevent-regions
: false
world-command
: world
price
: 100.0
world_nether:
max-x
: 10000
max-z
: 10000
min-x
: -10000
min-z
: -10000
alias
: '&c&lNether'
prevent-regions
: false
world-command
: world_nether
price
: 100.0
world_the_end:
max-x
: 100
max-z
: 100
min-x
: -100
min-z
: -100
alias
: '&e&lEnd'
prevent-regions
: false
world-command
: world_the_end
price
: 100.0
cooldown-sec
: 30
max-search-sec
: 30
command
: randomtp
prevent-regions
: false
avoid-blocks
:
- OAK_LEAVES
- SPRUCE_LEAVES
- BIRCH_LEAVES
- JUNGLE_LEAVES
- ACACIA_LEAVES
- DARK_OAK_LEAVES
sign-line:
'1'
: '&b&lRandomTP'
'2'
: '&a
{world
}'
'3'
: ''
'4'
: '&eClick to teleport'
messages:
prefix
: '&8&l
[&b&lRandomTP&8&l
]'
permissions
: '
{prefix
} &cYou do not have permission to do this.'
sign:
permissions
: '
{prefix
} &cYou do not have permission to create randomtp signs.'
create
: '
{prefix
} &aYou have created a sign for world
{world
}.'
shift
: '&7To remove a sign press &cshift + left click'
world:
no-exist
: '&cThis world doesn''t exist.'
teleport:
already
: '&cAlready searching for random location'
started
: '&aStarted searching random location.'
searching
: '&eSearching for a random location
...'
complete
: '&bYou''ve been teleported to random location'
canceled
: '&cRandomTP search has been canceled'
want-cancel
: '&cIf you want to cancel RandomTP use
{command
}'
cooldown:
already
: '&cYou have to wait
{cooldown
} seconds before another random teleport.'
finish
: '&aThe cooldown has finished, now you can teleport.'
dependencies:
vault:
enabled
: false
messages:
no-balance
: '
{prefix
} &cYou do not have enough money. Price
{price
} $, and you
have
{balance
} $'
successfully
: '
{prefix
} &aYou successfully paid
{price
} $ for RandomTP'
error
: '
{prefix
} &cError on payment
:
{error
}'
playernpc:
enabled
: false
text:
search
:
- '&bRandom Teleport'
- '&a
{world
}'
- '&e&lRIGHT CLICK'
searching
:
- '&bRandom Teleport'
- '&aSearching location
...'
glowing-color:
searching
: AQUA
Code (Java):
RandomTPAPI.
getRandomLocation
(world
)
;
//Returns a random location at world
RandomTPAPI.
teleport
(Player player, World world, Biome biome
)
;
//Teleports player to a random location with biome at world.
RandomTPAPI.
teleport
(Player player, World world
)
;
//Teleports player to a random location at world.
RandomTPAPI.
cancelCooldown
(player
)
;
//Cancels actual cooldown of player.
@EventHandler
public
void onRandomTP
(PlayerRandomTeleportEvent event
)
{
Player player
= event.
getPlayer
(
)
;
Location location
= event.
getLocation
(
)
;
}