Jump to content

[solved][1.7.10] LivingFallEvent get not catched


Recommended Posts

Posted

I just want to Register an LivingFallEvent, to prevent players Fall-Damage, but the @SubscribeEvent is not catched somehow....

 

 

 

package com.nextlevelminecraft.cad435.TNL_Client_Dependencies.Glider_Framework;

 

import cpw.mods.fml.common.eventhandler.SubscribeEvent;

import net.minecraftforge.event.entity.living.LivingFallEvent;

 

public class PreventGliderFalldamage {

 

    @SubscribeEvent(receiveCanceled = true)

    private void onFall(LivingFallEvent event) {

 

        System.out.println("EVENT!");

 

 

        if (event.entityLiving instanceof EntityPlayerMP)

            if (event.source  == DamageSource.fall)

            if (Framework.isGliderinInventory((EntityPlayer) event.entityLiving)) {

 

            //todo here

 

            }

 

    }

 

}

 

(Console didn't print out "EVENT!" at any time...)

 

According to this list: https://dl.dropboxusercontent.com/s/h777x7ugherqs0w/forgeevents.html

it has to be registered on MinecraftForge.EVENT_BUS , wich i've done Here:

 

 

    //main class

    //some code here...

   

    @Mod.EventHandler

    public void PreInit(FMLPreInitializationEvent e)

    {

        MinecraftForge.EVENT_BUS.register(new PreventGliderFalldamage());

        FMLCommonHandler.instance().bus().register(new TNL_ClientProxy());

        com.nextlevelminecraft.cad435.TNL_Client_Dependencies.MoreStuff.MoreStuff.PreInitial();

 

        proxy.ServerChecker();

        proxy.ClientChecker();

        proxy.ClientPreInit();

 

    }

 

    //some code here...

 

 

 

and i think i had this with an PlayerLoggedOutEvent too, a short time ago but haven't think about it because i did it another way...

 

(running on Forge #1291)

Posted

Event handling methods need to be public; yours is private.

 

thats it, thx!

 

and the lines of code below the "if(..." are actually marked as a comment, but idk why the "/*" symbols aren't there^^

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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