Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hello guys, this isn't an easy one as I can't reproduce the error. So I'm not sure if it's something I'm doing wrong, or maybe other mod in the pack my Mod is on causing this issues.

 

I have an apple that apply many Vanilla Potions effects, and we heard already a few times people die when the effect runs out, or it says they die (Not sure what this mean) apparently they are like stuck in the "Die animation" and when they relog they didn't really die. (I'm downloading a Twitch VOD to see hoe exactly this happened)

 

So, for a start, this is the apple code. I think, but not sure, that maybe Health Boost maybe the issue. I have seen that when you change dimensions the extra hearts don't show anymore (Same for absorption)

 

    protected void onFoodEaten(ItemStack itemStack, World world, EntityPlayer player)
    {
        if (!world.isRemote)
        {
        	player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 19200, 0));
        	player.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 4800, 4)); //Absorption
        	player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 19200, 1));
        	player.addPotionEffect(new PotionEffect(Potion.resistance.id, 19200, 0));
        	player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 19200, 0));
        	player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 19200, 1));
        	player.addPotionEffect(new PotionEffect(Potion.field_76434_w.id, 19200, 4)); //healthBoost
        	player.addPotionEffect(new PotionEffect(Potion.field_76443_y.id, 19200, 0)); //saturation
        	player.addPotionEffect(new PotionEffect(Potion.heal.id, 200, 0));
        	}


    }

 

  • Author

Thanks diesieben07. Yes I guess I could do that and make my mod to print something on console each time a player dies, and if someone gets this dead again I can ask them to send me that. The problem will be that most likely they wont have a save of that log and not even a crash report.

But I like your idea to see what caused the dead.

This would be easier if I could reproduce it, but I have tested inside the pack, and only with my mod and nothing I can't get this dead to happen to me.

 

Thanks for the answer and the idea on how to see whats going on, gonna see how I can implement it.

in the minecraft folder there should be a folder called logs , where there is ALWAYS the latest.log so they have a log even if it wont crash

  • Author

in the minecraft folder there should be a folder called logs , where there is ALWAYS the latest.log so they have a log even if it wont crash

Ohhh ok ;) Thanks for the info.

  • 4 weeks later...
  • Author

Ok guys, so I got that code, so now when someone dies, you can see in chat what was the cause.

 

Back to the problem, here we can see a player "died" but not message pop up, so he technically didn't die. Anyone has any guess on what can be causing this. I'm almost sure it's some other Mod on the pack, but I dont know.

 

Here is the "death" showing no message, happening when the effects from my item run out.

 

http://www.twitch.tv/vash505/v/17579684

 

This is how the chat looks like when someone dies.

 

http://i.imgur.com/3Jt6Cs9.jpg

 

The code that makes this to display

 

    @SubscribeEvent
    public void onLivingDeath(LivingDeathEvent event) {
    	if(ConfigValues.trackPlayersDead)
    	{
    	
    	if (event.entityLiving.worldObj.isRemote)
    		return;
   	
    	if(event.entityLiving instanceof EntityPlayer)
    	{
    		System.out.println("A player died!");
    		
			EntityPlayer thePlayer = (EntityPlayer) event.entityLiving;

			if(event.source.getSourceOfDamage()!=null)
			{
				System.out.println("getSourceOfDamage: " + event.source.getSourceOfDamage());
				thePlayer.addChatComponentMessage(new ChatComponentText("Player died - Source of Damage: " + event.source.getSourceOfDamage()));
			}
			else if(event.source.getDamageType()!=null)
			{
				System.out.println("getDamageType: " + event.source.getDamageType());
				thePlayer.addChatComponentMessage(new ChatComponentText("Player died - Damage type: " + event.source.getDamageType()));
			}
			else
			{
				thePlayer.addChatComponentMessage(new ChatComponentText("Player died with no extra details."));
			}

			if(event.toString()!=null)
			{
				System.out.println("event.toString: " + event.toString());
			}

			if(event.source.getClass()!=null)
			{
				System.out.println("event.source.getClass: " + event.source.getClass());
			}

    	}
    	
    	}//END IF
    	
    }

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.