net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent Java Examples

The following examples show how to use net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CommonHandler.java    From GokiStats with MIT License 5 votes vote down vote up
@SubscribeEvent
public void playerRespawn(PlayerRespawnEvent event) {
    EntityPlayer player = event.player;
    if (!player.world.isRemote) {
        if (GokiConfig.globalModifiers.loseStatsOnDeath) {
            for (int stat = 0; stat < StatBase.totalStats; stat++) {
                DataHelper.multiplyPlayerStatLevel(player,
                        StatBase.stats.get(stat),
                        level -> level - (int) (GokiConfig.globalModifiers.loseStatsMultiplier * level));
            }
        }
        GokiPacketHandler.CHANNEL.sendTo(new S2CSyncAll(player), (EntityPlayerMP) player);
    }
}
 
Example #2
Source File: ServerHandler.java    From NotEnoughItems with MIT License 4 votes vote down vote up
@SubscribeEvent
public void loginEvent(PlayerRespawnEvent event) {
    NEIServerConfig.getSaveForPlayer(event.player.getName()).onWorldReload();
}
 
Example #3
Source File: ServerHandler.java    From NotEnoughItems with MIT License 4 votes vote down vote up
@SubscribeEvent
public void loginEvent(PlayerRespawnEvent event) {
    NEIServerConfig.forPlayer(event.player.getCommandSenderName()).onWorldReload();
}
 
Example #4
Source File: PlayerTracker.java    From TFC2 with GNU General Public License v3.0 4 votes vote down vote up
@SubscribeEvent
public void onPlayerRespawn(PlayerRespawnEvent event)
{

}
 
Example #5
Source File: ProxyCommon.java    From WearableBackpacks with MIT License 4 votes vote down vote up
@SubscribeEvent
public void onPlayerRespawn(PlayerRespawnEvent event)
	{ sendBackpackStack(event.player, event.player); }