ForceRespawn
ForceRespawn
ForceRespawn is an API meant to be implemented by minigame plugins. When used, it will force the player to respawn at their next death, bypassing the death screen. This is ideally used in place of the normal method of using the EntityDamageEvent and cancelling the event if the player's health minus the damage is less than zero, because that method does not take armor into account.
Are you a server owner?
If you were directed here because a plugin requires this as a dependency, just use the download button on the right and put the plugin in your plugins folder. If a version is not yet available for your Minecraft version, you can check for one at the provided Jenkins server below (these are not guaranteed to be stable).
Are you a developer?
Great! Here's some example usage of our API:
// The ForceRespawnEvent is called 1 tick after PlayerDeathEvent. // Calling event.setForcedRespawn(true) will force a respawn. @EventHandler public void onForceRespawn(ForceRespawnEvent event) { if (event.getPlayer().getName().equals("Notch")) { event.setForcedRespawn(true); } } // Sends the packet to force-respawn a player. ForceRespawn.sendRespawnPacket(Player);
You can add this as a maven dependency by using the following repository and dependency snippets:
<repository> <id>chaseoes</id> <url>http://repo.chaseoes.com/content/groups/public</url> </repository> <dependency> <groupId>com.chaseoes</groupId> <artifactId>ForceRespawn-Plugin</artifactId> <version>1.2.1</version> </dependency>
Also make sure that ForceRespawn is added in the depend or softdepend in your plugin.yml. If you require additional help in implementing this, please join the #tf2plugin channel on irc.esper.net and someone will help you out!
update to 1.12.2 RIGHT NOWWWWW!!!!
Someone update pls...
can i continue this project, and update this to the newest versions?
@chaseoes
I have downgraded my server to 1.7.2 R0.2 (beta) and i can't drop items ...
@chaseoes
Ah ok. Thank you for the fast response
@Defelot1
There's currently only a version for 1.7.2-R0.2.
I have lots of problems with the plugin. 1 When i use /pl the plugin is in red 2 This plugin doesn't let users and ops pickup or drop items 3 When the players disconnect their inventory clears... I need this plugin for village defense
when my players disconnect all items of inventory "cleared" -.- please solve
plugin is in red on /plugins and dont work
Hey psycowithespn!
I tried using this and I got this error:
Caused by: com.chaseoes.forcerespawn.exception.ForceRespawnException: Api call when ForceRespawn is disabled! at com.chaseoes.forcerespawn.ForceRespawn.threadCheck(ForceRespawn.java:69) [?:?] at com.chaseoes.forcerespawn.ForceRespawn.sendRespawnPacket(ForceRespawn.java:26) [?:?]
Do you know why I get this error?
@TheAJ471
Sure, you would just use the PlayerRespawnEvent in that case.
Can I add in my own stuff for teleporting a player to a certain location when they respawn?
@tgndev
The plugin was just updated to 1.7.2. If you were using a past version of this plugin, then ForceRespawn will do nothing. All it will do is tell you to yell at me to update. The error Rendering Tick is unrelated to this plugin because it is impossible for the plugin to do anything on a version that it does not support.
Hi, if you know Turqmelon (The Nexus MC Developer) use this ForceRespawn API. On 1.7.4, if someone died, it will crashed with error Rendering Tick. Thanks! :)
@psycowithespn
Well no. Not even the field change should make a difference. I've made a version using reflection which can run on old versions and will run on future versions as well without needing to change. You just need to make things more dynamic and not lock the field or method names. https://gist.github.com/kumpelblase2/d77d00cd2ee5ba9e5c8d Take a look, try it and do whatever you want with it. (you probably have to change the import of your ForceRespawnEvent if you copy it.)
@kumpelblase2
I respect your opinion and even agree that this is possibly overkill, however the reason it was created was to solve a major bug in our plugin, tf2. Since we are constantly adding new things to it and didn't want it to be version locked by nms to the latest version, so this was created for ease of updating and backwards compatibility. Nothing in tf2 has to change each minecraft update, and anyone from 1.2.5 to 1.6.2 can get the latest updates to it. If we used reflection back around 1.3, then it would have broken due to a field name change. This project was started just for the respawn spoofing, however I would like to see this grow, using craftbukkit methods in odd ways to accomplish things. This is just my opinion though.
Well, I don't dislike the idea, but making a separate plugin which contains the api (which is actually nothing more than creating and handling one single event) is a bit too overkill and is, in my eyes, not really necessary at all. This could be put done using two classes and thats it, nothing more. Even including independency from the minecraft version (using reflection). It is just silly to create a new handler class where you change one import for one class, seriously.
This is nice! I will use this on my next online bukkit gamemode :D
@JvS15NL
On its own, this plugin does nothing. This plugin just allows other plugins to cause people to respawn, like how Tagapi handles nametags. If you need help implementing this into your plugin, hop on the irc listed above and say my name or file an issue on the ticket tracker. I am currently working on an example plugin that will force respawn everyone with a permission.
Doesn't work for me..