Random Spawn
Random Spawn is a simple plugin that spawns players at a random location in the world on their first login (configurable) and when they die. Sleeping in a bed disables the random spawn function and players will respawn at their bed when they die.
This is the first plugin I made. The idea for this plugin came from NuclearW's SpawnArea. I've used that for a while on my own server but thought it could use some extra features, so I tried to make one myself.
Thanks to NuclearW and Bretflann for being awesome and letting me use some of their code!
Thanks to WayGroovy and Francis Fenderson for donating!
Features:
- Random Spawn will not spawn players in:
- lava
- cacti
- water
- fire
- You can set a border where the players will random spawn inside
- After a player has lain or slept in a bed he won't be random spawned anymore and he will re-spawn at their bed if he dies
- This can be disabled when setting usebeds: false in the world.yml
- You can configure if players will be random spawned on there first join. (if false they will spawn at the map's default spawnpoint)
- you can set the first spawn location with the /setspawn command
- You can exclude players from being random spawned using the RandomSpawn.exclude permission node
- Random Spawn spawns players in a set area. You can define this area per world in the worlds.yml.
- Multiworld compatable
- Random Spawn signs. Type: [RandomSpawn] on the first line of a sign. To specify a world, type the world name on the second line. Configurable in config.yml.
- Custom messages after respawning.
- Spawning on command. since 2.4
When updating to version 1.6, please remove all the yml's and reconfigure them!
Commands:
See this page!
Permissions:
The permission nodes are optional.
- RandomSpawn.info Defaulted true
- RandomSpawn.help
- RandomSpawn.reload
- RandomSpawn.configure
- RandomSpawn.exclude
- RandomSpawn.setfirstspawn
- RandomSpawn.tpfirstspawn
- RandomSpawn.placesign
- RandomSpawn.usesign Defaulted true
- RandomSpawn.spawn
To-do list:
- Increase performance Increased performance a lot in version 1.6.1
- Circular spawn area's
- Any idea's?
Conflicting Plugins:
- SpawnX
Source available on Github!
If you like what I'm doing. Consider donating :) Please use the donate button in the top right.
-
View User Profile
-
Send Message
Posted Jul 18, 2012@beastfeaster
Before you remove essentials try to see if you can disable the spawning features of it in it's config.
-
View User Profile
-
Send Message
Posted Jul 18, 2012yup, youre right. i COMPLETELY removed essentials and random spawn seems to be working perfectly. argh, why must i choose? essentials make things so easy but i absolutely have to have your plugin.
well, looks like ill be looking for alternatives to essentials. thanks for all your help!
-
View User Profile
-
Send Message
Posted Jul 18, 2012@beastfeaster
Hmm, your yml seems fine though you should try the commands to see if they work. /rs help will give you a list of them.
While your at it could you confirm that there's no plugin interfering with the random spawning? Like Multi Verse or some other multi world plugin. Sometimes these plugins tend to take over all re-spawning making my methods completely useless. If you are getting the randomspawn messages like: "You wake up in an unkown place." but aren't randomspawned this means a plugin is interfering.
-
View User Profile
-
Send Message
Posted Jul 18, 2012josvth - ha! thats hilarious! random isnt always so random when computers are invovled it seems. i used to notice that with random number generators. never trusted them!
i dont understand why this plugin is being so difficult. it seems very straigthforward but refuses to cooperate. do you mind taking a look at my .yml? here is a copy on pastebin:
http://pastebin.com/F5fhHA2b
all im trying to do with it is: - spawn randomly within 3000 of 0,0,0 - all players spawn in different locations at first join - all players spawn in different locations at death - all players spawn at bed once they have used their bed
-
View User Profile
-
Send Message
Posted Jul 18, 2012@beastfeaster
They spawn randomly within the entire set area. However it sometimes looks that people are spawned next to each other. But the other day I was having a survival battle with some of my friends. 4 of us were spawned within a 100 meter radius and the last guy was spawned 2 kilometres away.
-
View User Profile
-
Send Message
Posted Jul 17, 2012hello, hate to bug you again. can you confirm that players will spawn randomly within the entire set area or do they only spawn at set spawn points within that area? i think thats what im struggling with on this plugin. thanks!
-
View User Profile
-
Send Message
Posted Jul 16, 2012@chrisknyfe
Hello chrisknyfe,
I'm glad you like the plugin. It's an old one but it's still doing it job!
I knew about that the player.dat file is only in the main world folder and I thought I took that into account. Seems not so I will change that. Thanks for the tip about the Server.getWorld(0) that would definitely come in handy!
Greetings Josvth
-
View User Profile
-
Send Message
Posted Jul 15, 2012Two things in this plugin that I've been struggling with for weeks that I've finally figured out:
1. You have a bug in RandomSpawn.isFirstJoin() in terms of multi-world support. You check whether the current world has a "player.dat" file, assuming that if the current world I'm logging into is normal, that it must be the default world. This is not always the case, especially on servers that have a skylands world of type "NORMAL". You need to ignore the world I'm spawning into, and instead figure out how to ask Bukkit which world is the one that contains all the player.dat files.
EDIT: I asked #bukkitdev, they tell me that you can use "org.bukkit.Server.getWorld(UUID uid)", specifically "getServer().getWorld(0)".
This bug manifests when I log out and log in to the secondary NORMAL-type world (my skylands) and I end up back at that world's spawn, instead of where I last logged off from.
2. I discovered an undocumented feature: if I have one primary world where everyone has a randomspawn, and I die in any other world, and in Multiverse I set the respawn world of all other worlds to the primary world, when I die in those other worlds I go to the primary world's spawn. However, if those secondary worlds have "keeprandomspawns: true", even if they're not configured to have a random spawn, dying in those worlds will take me to my randomspawn in the primary world. This is exactly what I wanted from this plugin: if I die in any world, I go to my randomspawn in the primary world now. This is great!
-
View User Profile
-
Send Message
Posted Jul 15, 2012also, im using permissions ex. are there any specific nodes the default player should have to be random spawned (until he lays in bed)
are there any commands i must use to get it going?
maybe im understanding plugin wrong. do i have to actually manually set areas from with in the game?
all i did was: install plugin edit config restart server
-
View User Profile
-
Send Message
Posted Jul 15, 2012done. still having problems, must be essentials. argh..
oh, is it:
x-min: 1500 x-max: 1500 z-min: 1500 z-max: 1500
or:
x-min: 1500 x-max: -1500 z-min: 1500 z-max: -1500
-
View User Profile
-
Send Message
Posted Jul 15, 2012@beastfeaster
This will do:
world:
randomspawnon:
- firstjoin
- respawn
spawnarea:
type: "square" (circle isn't implemented yet)
x-min: 1500
x-max: 1500
z-min: 1500
z-max: 1500
Hope it helps!
-
View User Profile
-
Send Message
Posted Jul 15, 2012hello! im having a hell of a time configuring this for some reason. i have essentials installed so that may be the problem.
what config should i use? i need: random spawn at death and first join i need players to spawn at beds i need a spawn radius of 3000 x 3000 from 0,0.
any help would be appreciated!
-
View User Profile
-
Send Message
Posted Jul 12, 2012Thankyou, this is just what I needed! When players join, they go to the tutorial room, kill themselves and can play the game spawning randomly in my pre-built map!
-
View User Profile
-
Send Message
Posted Jul 9, 2012Love the mod, but people keep spawning on top of the nether on nether maps. I hope we can get configurable height restrictions in Random Spawn in the future.
Edit: People are also getting kicked for moving too fast. Both of these happen when using the "teleport-from-[worldname]" thing.
-
View User Profile
-
Send Message
Posted Jul 3, 2012Can you please add a command to tp a user randomly in the set region using a command? That would be really useful, especially with ServerSigns.
-
View User Profile
-
Send Message
Posted Jul 1, 2012@josvth
Ahh, understandable. That's alright, I can find ways to improvise. Thanks once again :)
-
View User Profile
-
Send Message
Posted Jul 1, 2012@josvth
A warmup would be fine for the signs, seems like a good solution.
-
View User Profile
-
Send Message
Posted Jul 1, 2012@AS1LV3RN1NJA
No not yet. I'm considering adding a warm-up to that function. Maybe that will fix the problem.
-
View User Profile
-
Send Message
Posted Jul 1, 2012@josvth
Any news on the sign bug? If not, I'm guessing it will be fixed in the rewrite you're doing, any ETA on that?
-
View User Profile
-
Send Message
Posted Jul 1, 2012@sjwebster92
Good idea! However there is a plugin called Multispawn made by Tux2 that does exactly this. He's a nice guy and I don't want to take downloads away from him.
Here's the link to his page.