Filled Command to suicide, but return to server spawn

Discussion in 'Archived: Plugin Requests' started by lucasbuck, Jul 7, 2014.

  1. Offline


    Plugin category: Spawn and restart

    Suggested name: Reset Player

    What I want:
    I've expanded my server which runs for elementary students to include access at the local library. They bought their own accounts and let student play on the educational server. They asked if there was a way (after a student leaves) if they could kill the character, thus emptying inventory and have the respawn at the server spawn point (where the directions are posted). At this point, they have to walk the character back to the spawn before the next student can get on. Which is bad if the student used a bed and set the spawn far away.

    I see there's Homespawnplus, but that's way more than I need. I could just set a warp back to the spawn, but then people would abuse it by mining and transporting instantly back to town to store the stuff. Is there a way to have a command kill a player AND put them back to the server spawn, or would it be something simple someone could make? Thanks!

    Ideas for commands: resetplayer

    Ideas for permissions: none, should just work on self

    When I'd like it by: Sometime soon.
  2. Offline


    Isnt this basically the purpose of vanilla /kill?
    timtower likes this.
  3. Offline


    Kill would take them to their bed right?
    izarooni likes this.
  4. Offline


    Oh, right, sorry, didnt read though fully.
  5. Offline

    timtower Administrator Administrator Moderator

    RoaxZ Might have a solution for that:
    /spawnpoint <User> <x> <y> <z>
    Not sure if the console likes it though
  6. Offline


  7. Offline


    Use the plugin called 'Essentials' it adds a command to /setspawn and the command '/suicide' or /kill <playername> to always send them back to spawn after death, it also adds a ton of commands that would be useful like /sethome, /home to return, and many more. And makes it a lot easier for the school operators to monitor the server by using commands like /v or /vanish (while students are playing).

    If there is any problems with that, I will code the plugin if you need me to, just reply and tell me. :p
  8. Offline


    Thank you! But won't that over ride the regular suicide (which the kids use to get back home). This was more for the library staff to use to reset the machines when I can't be there. I thought if it had a different name, the kids wouldn't get it mixed up.
  9. Offline

    timtower Administrator Administrator Moderator

    lucasbuck Why not have a batch file to clear the player data when the server reboots?
  10. Offline


    It's not the server rebooting. The library bought 15 accounts that are registered to them. Kids sign up for one hour sessions. So what they want is, when someone leaves, they can quickly reset it for the next player. Empty inventory, back at the server spawn. I thought it would be an easy one to do, but if not it's okay.

    I do use Essentials. The issue is, I'm a teacher and not usually at the library (except this summer), so I need a way they can do the command from one of the PC's in their lab. They are general student accounts, so they won't have ops or anything to do kill.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 9, 2016
  11. Offline


    So... a command to reset the player, or do it on leave? Either can work. This would be fairly easy to do either way.
  12. Offline


    A command like /resetplayer would be better I think.
  13. Offline


    lucasbuck So you want a plugin that, on a command, clears a player's inventory, sets their health and food levels to full, resets their XP and teleports them to spawn? That would be pretty easy to code, I'll have it done in half an hour.


    Here you go!

    You will need to set the reset spawn point with the command /setresetspawn, and will need the permission resetplayer.setspawn to do so.

    To reset a player, from in game or from the console use the command /resetplayer <player name>. You will need the permission resetplayer.reset to do so.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 9, 2016
  14. Offline


    Thank you, and I'm so sorry, I should have been more specific on one part (and changed the wording in the original request). As I mentioned in a late reply, the people doing the 'resetting' aren't going to have ops, they'll just do it while walking around the lab after a user leaves. If it can't use the server spawn that's fine, I can always set the resetspawn myself. But the command to actually reset the player would have to be just plain /resetplayer (without the name and without permissions). The workers at the library aren't oped, they just have a lab full of computers with regular player accounts. And if I gave everyone permission, people would be resetting each other.
    I hope that makes sense and sorry I wasn't more clear. I'm also thinking outside of the library usage, it would be good for my players to use as a way to get back to town, but without being able to haul a ton of stuff back from a distant place. So I don't think I'd add taking away experience. Maybe just make it a simple suicide, then spawn them back at the point. That should still clear their inventory and reset hunger, without clearing experience, shouldn't it?
  15. Offline


    lucasbuck I might have a go when I get on my PC so basically resetplayer whipes the inventory resets health etc and teleports them to spawn? Maybe an an account system of some sort would be better for users to log in and out etc but that's a decently large project.
    Here is the plugin!3dM3FI5I!Ebg2H6nO5KiOfANn_YmbzQFVaXlcx6lDFtzrIhOG1DQ
    /reset teleports you to spawn wipes your inventory armor and potion effects and reset the health
  16. Offline


    lucasbuck Ok, I get you now. I'll have it fixed in a few minutes.

    lucasbuck Here you go. Now you only need to type /resetplayer to reset the account which you are using. There is no permission.

    If you'd like a simple suicide command as well I can add that for you.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 9, 2016
  17. Offline


    Isn't using a command a bit of a hassle?
  18. Offline


    Whenever a player dies in Minecraft they lose all of their experience, unless you make a plugin to prevent that.

    What would you use then? A bridge?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 9, 2016
  19. Offline


    After I cry.

    I'd use a PlayerJoinEvent. I don't know what OP wants gone but couldn't you set BedSpawnLocation to null if there is one, getInventory then clear, getArmorContents then clear, getSpawnLocation of the main world and teleport, set level 0, set exp (float) 0. Probably not the best way but I think it's better than a command.
  20. Offline


    izarooni They problem with that is that if a player needed to relog for whatever reason during their session, all of their progress would be lost.
  21. Offline


    Thanks so much to dsouzamatt and imjack16, but work great! The issue is the server mainly runs for elementary kids who use it from home. The library bought some accounts and are letting kids use them. For there, it's good to just have the command, but I don't want to get all into restarts and such as it would effect normal players. The kids in the library just get up and leave, they don't log out, so they needed a way to reset. Again, thanks for all the help!
    dsouzamatt likes this.

Share This Page