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.
/rs setarea circle 1995
Returns:
/rs setarea [square/circle] <radius> or /rs setarea <xrange> <zrange> or /rs setarea <xmin> <xmax> <zmin> <zmax>
The plugin will not allow me to use a circle. I am on 1.3.1 RB. Using 2.2.1
EDIT
I see it hasnt been implemented yet. Can you add two very easy things for me?
@TerraVale
You're gonna leave me for somebody else! You bastard! :p
No just kidding. Use the other plugin if it works for you and I will see what I can do about this kicking problem.
@josvth
In the mean time, I'm going to use another extremely lightweight, random plugin to prevent the server from kicking people for moving too quickly. Once you publish a 1.3.1 update (providing you will be?), do you believe that it will be possible to fix the problem?
I can always just go and write a small plugin that will warp people at a random chance to 10-20 predefined spawn points, however I'd much rather implement use of your plugin to ultimately prevent any possible way of spawn camping/killing, etc.
@josvth
As long as it doesn't drop them into the void!
@Poopfish
It will only spawn players at the highest block in the grid. If that's what you want, then it works. ;)
Does this plugin work with this terrain? http://dev.bukkit.org/server-mods/skygrid-gen/
@TerraVale
That's true. Random Spawn should block every kick during the 'nodamagetime' after every random spawn. But it could be that the server overrides this because it thinks the player is cheating. It does these strange things sometimes.
@SavageCore
This doesn't seem to be a problem in my plugin. Does this happen all the time or just sometimes?
2012-08-07 16:17:49 [WARNING] Failed to handle packet: java.lang.NullPointerException java.lang.NullPointerException at net.minecraft.server.ServerConfigurationManagerAbstract.moveToWorld(ServerConfigurationManagerAbstract.java:371) at net.minecraft.server.ServerConfigurationManagerAbstract.moveToWorld(ServerConfigurationManagerAbstract.java:322) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:1070) at net.minecraft.server.Packet205ClientCommand.handle(SourceFile:30) at net.minecraft.server.NetworkManager.b(NetworkManager.java:281) at net.minecraft.server.NetServerHandler.d(NetServerHandler.java:109) at net.minecraft.server.ServerConnection.b(SourceFile:35) at net.minecraft.server.DedicatedServerConnection.b(SourceFile:30) at net.minecraft.server.MinecraftServer.q(MinecraftServer.java:583) at net.minecraft.server.DedicatedServer.q(DedicatedServer.java:212) at net.minecraft.server.MinecraftServer.p(MinecraftServer.java:476) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:408) at net.minecraft.server.ThreadServerApplication.run(SourceFile:539)
Get this after a player dies. 1.3.1-R1.0 (Build #02317)
@josvth
Alright, so I can't seem to fix the getting kicked for hacking... it's because heading into that world, you end up at it's spawn point, then suddenly jump all the way over to the random spawn point, and the server then just kicks the player...
I proved this by logging in and setting the world spawn right next to the place where Random Spawn saved my random spawning location - afterwards it didn't kick me when random spawning :)
@TerraVale
Okay, and did you set a 'nodamagetime' in the config.yml?
Awesome, now all we need is a 1.3.0 version of bukkit :P
It's only after random spawning that it kicks me :0
@po5
In the next version you can set the block types. ;)
Im trying this plugin on a world with alot of water. I wanted players to spawn randomly somewhere above it. But the plugin just seems to freeze my server when i join. I guess its trying to look for a suitable place to spawn someone, but any place just above the water would be fine tbh
@TerraVale
Are you getting kicked after Random Spawning or just with a normal teleport? I've blocked the kick with the "nodamagetime" configurable. Meaning during this time you can't be kicked.
A configurable like "beds-as-worldspawn" could indeed be a use full feature for this plugin. When set to false it will spawn the player at his bed if he teleports to a world where his bed is in. There might be a problem that this would conflict with nether portals but that's something I need to test.
@josvth
Alright, sounds good! I'll give it a test later tonight, so in 8 to 10 hours! Unfortunately, I'm busy until then :(EDIT: Wow! It actually works, there is only one small, probably easily fixable, error. When teleporting into the new world, the server kicks me for "moving too fast :( (Hacking?)"
Otherwise, the randomly occurring nether portal does not appear anymore, going to your bed (via means of dying or /home) will take you straight to your bed with no errors, and you will always spawn in the same location after randomly spawning once!
Would it be possible to have it take you straight to your bed if you've slept in one on the alternative world that has random spawns? That would also be a significantly useful feature! (Unless it's already available?)
Thank you :)
@TerraVale
Sorry for my late response. But I think I have the solution for you, or at least for some of you problems. However the random Nether portals appearing, it's a big question for me :P
I have a development build for you. Could you test it for me and report the results?
Here it is!
Edit: In that version you can change the colour of the message as well.
@josvth
Okay, so I'm having some problems. Quite a few problems.
This is my world.yml: http://pastebin.com/gPpRGtUz
First problem: Users teleporting to the world with random spawns on usually end up 2 blocks under the surface, suffocate, and die. I've pre-generated the world, and use MultiWorld.
Second problem: keeprandomspawns does not work. Users are always spawning in random locations.
Third problem: Based on how my server is set up, I need the users to random spawn going from TerraVale_spawn to TerraVale_freebuild, but only once, if possible! Users on my server have access to /tpa, and when teleporting to their friend in TerraVale_freebuild from TerraVale_spawn, they get randomly teleported again, unfortunately.
Fourth problem: Users set home with a bed using essentials. Typing /home bed takes them to their bed, but then they randomly spawn again. When they get back to their bed, a nether portal has spawned right next to the bed. I'm not sure why Random Spawn isn't working the way it should :(
Conflicts with essentials? I have no clue..
@josvth
Sorry, I can't make much sense of that. yes we have a pre-generated world but spawning in lava? it is a deathban server and I have removed PermissionsEx and Multiverse just for this plugin