Filled Random spawn plugin (with commands)

Discussion in 'Plugin Requests' started by matija131, Apr 19, 2020.

Thread Status:
Not open for further replies.
  1. Hey guys, I need a plugin and was hoping somebody could make it for me.

    I need a plugin that when you die or join the server for the first time would respawn you somewhere random in the world, unless player has placed down a bed, then he would respawn in his bed. If the player has placed down multiple beds then he would spawn in the first one he placed.

    I need this plugin to be multiworld compactible, the world you died in, you will respawn in.

    I also need the plugin to have 2 commands.
    If the player is OP he can type in "/randomspawn spawnpoint", which means, when he dies, he will spawn on the block he typed the command on.
    To unset his spawn point he would type in "/randomspawn nospawnpoint" and he would be spawning randomly around the world again.

    If an OP player set his spawn point using "/randomspawn spawnpoint" and then I deop him, his spawn point would be deleted and he would be spawning randomly around the world again.

    If youre already considering this, please make sure the player doesnt spawn on water, underwater or outside world borders.

    If youd like an extra challenge, and by that I mean this is completly optional, you could make it so the player would only respawn on sand blocks (or make it configurable so you can set it to any block). I would really like this feature if you have some extra time on your hands :)

    I need this plugin for spigot 1.8, but it would be awesome if you can make it compactible with later versions of mc too, just in case I decide to upgrade the server.

    And please dont use /rs, instead use /randomspawn for commands!
    Idea for commands permission: randomspawn.admin [OP default]

    That is all, if you have any questions feel free to ask!
    I would be very grateful if you could take your time to make this and please dont rush it if you do, I can wait!

    Thanks in advance :D
  2. Offline


    Im happy to give this a go, I think it would be done in a few hours, Ill keep you updated.

    If a player dies in the nether should they respawn in the nether?

    I have set it so that you will respawn in the world that you would normally respawn in but randomly, and if the admin has set a respawn point in the world they would normally respawn in it will spawn them there, let me know if you have any issues. If you do please post them on the github repository on the link provided :)
    Last edited: Apr 21, 2020
  3. Awesome! Ill test it out today and let you know if I have any problems.
    Thank you very much! :D

    Aight I tested the plugin and it does work great, although I found some things I really want you to fix/change, if thats possible :)

    1.First thing I noticed, whenever I die or /kill myself the plugin respawns me in the default world and not in the world I died in, the nether thingy doesnt matter since I wont allow going into nether so if anybody dies there, plugin can respawn him in there
    This is quite a big feature and I really need it to work.

    2. When I die or /kill myself the plugin spawns me over 3-24 million blocks away from the spot I died
    If you could set it to spawn you within 5000 block radius it would be perfect!

    3. When I shrink the world border (tested by setting it to 4000 blocks, which is prob gonna be a default map size on the server) the plugin spawns you on the worlds default spawn point (/setworldspawn)

    4. It would be great if you could make it so players dont have to lie down in their bed first to set their spawnpoint, instead it should set when players place the bed down

    Thats all, everything else works great!
    Im not sure if I tested every feature there is or should be so I might add some more things to the list later.

    Again, thanks alot for taking your time to make this for me, really appreciated! :D
    Last edited: Apr 23, 2020
  4. Offline


    The plugin should respawn you in a random position that you would of respawned in if the plugin wasnt there, if you remove the plugin and you die in a multiverse world do you respawn in the world you died in or the default world?

    The plugin currently spawns you randomly anywhere within the world border but will always be atleast 1000 blocks away from the world border, this can be lowered to allow spawning closer to the world border though.

    The bed functionality can be added, I will have the bed functionality sorted within the next few days and I will get back to you, and I can sort the multiverse compatability soon too.
    Last edited: Apr 23, 2020
  5. Im not quite sure what you mean, what I did try was teleporting to a different world (world2), removing the world manager plugin to make sure its not causing the problem, and the killed myself in that world (world2) but I still respawned in default world (world1) on its default spawn location.

    As far as im concerened, players can spawn 1 block away from world border, so you can lower it to 1

    I look forward to hearing from you
    Once again, thanks!

    P.S. If you need a world manager plugin im currently using here it is: <Edit by Moderator: Redacted not allowed paid resource url> im limited with world manager plugins because im on 1.8, but that will probably change in the future if and when I upgrade the server. So if possible, please add support for both this plugin and multiverse plugin if thats what you were referring to with "I can sort the multiverse compatability soon too"
    Last edited by a moderator: Feb 5, 2021
  6. Offline


    Apologies, I meant remove my plugin, do you then correctly spawn in world 2 like you would want? obviously you wouldnt have the random spawn Im just thinking about how I could impliment the feature you have requried.
  7. Oh yes, just tested that and its definetly something on my side. When I remove randomspawn plugin and kill myself in world2 I still respawn in world1. I cant seem to find the issue, ive looked thru some config files and none of them have an option for setting a default world or a default spawn. Im not using any of the setspawn plugins so I really dont know what could be causing it.

    Ill have a more detailed look tomorrow and let you know if I find anything.
  8. Offline


    Okay thats good news, my plugin should work perfectly if you can get the plugin to make you respawn in the world that you die in. If not im sure we can find something to sort that.

    When a user places multiple beds you said the first one should be set as the spawn, what should happen when the first bed is broken? default back to random spawning?

    If a user has multiple beds and they sleep in a bed that isnt the first bed placed, should they now spawn at the bed they slept in or should they continue to spawn at the most recently slept in bed?

    Also what should occur if another player breaks a users bed

    I have just released a new update for the plugin with the bed functionality you requested, the setting is off by default but you can change the setting to true in the config.yml, you will most likely need to delete your current randomspawns folder from your server.

    Let me know if you have any issues :)
    Last edited: Apr 24, 2020
  9. Ive done some thinking and this is what I came up with...
    What if a player respawned in the most recent bed he placed but whenever he right clicks on the bed (even during day when he cannot lie down) his respawn point would be set to that bed he right clicked, so if he placed down multiple beds he would respawn on the one he most recently placed or the one he most recently right cliked.

    When he places down a bed or right clicks it a chat message would appear saying "&bRespawn point set".

    If their respawn point bed has been destroyed (if he or somebody else destoryed it) then make a player respawn randomly around the world until he right clicks an already placed down bed or until he places down a new one.
    Just make sure they cannot set their respawn point on somebody elses bed :p

    What do you think about all this? I hope im not overwhelming you with work, if so, ill come up with something simple :)

    Thanks for the update, btw did you lower the number to allow spawning closer to the world border (1 block away from it)?
    Ill take a detailed look at my config files today to see what up, I hope ill be able to find it
  10. Offline


    I have reduced the limit to 20 blocks, the world border value isnt always exactly where the border is, e.g. if it is 4000 blocks, the coords that you can go up to are 3990, atleast for my server that was, 20 was a safe number and seemed to work perfectly fine.

    Ill add a setting to the config which will let you choose if the player spawns in first placed, or most recently placed, if the user has slept in a bed. It will automatically override my plugin and use the default respawn method like you would like.

    Ill add custom messages to the config for the next update

    I dont mind too much, gives me something to do and help someone in the process, the next update will be done by the end of the day or tomorrow :)
  11. Great! Thank you!

    First test of the updated version: plugin keeps spawning me outside the world border which was set to 3000 blocks for testing purposes, also spawns me in water most of the time
    Last edited: Apr 24, 2020
  12. Offline


    Im really sorry for the delay, ive been super busy the previous couple of days,

    I have added the option to choose the most recently placed bed or the first placed bed, and custom messages in the config

    The only thing that could be causing that behaviour was if the border was not in the center of the world, that has been fixed now so should work fine. And a proper check for the water below the player now takes place when they are spawned.
  13. Everything seems to be working perfect now!

    Thank you very much for filling my request :)
  14. Offline


    Brilliant news, if you run into any issues post an issue thread on the github with the link below, I dont check these forums too often so a response will be much quicker over there
    Last edited: Apr 27, 2020
    matija131 likes this.
Thread Status:
Not open for further replies.

Share This Page