ForceRespawn

4.6k Downloads

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!

Development Builds

Development builds of this project can be acquired at the provided continuous integration server. These builds have not been approved by the BukkitDev staff. Use them at your own risk.