Jump to content

Recommended Posts

Posted

Hello,

 

I'm stuck on a wierd problem some how this does not work?

    @Override
    public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity p_149670_5_)
    {
        p_149670_5_.attackEntityFrom(DamageSource.fallingBlock, 2);
    }

 

anyone knows what i'm doing wrong?

I'm always happy to help others!

 

Java is not my main programming language but I have alot experience in PHP/HTML/JS/CSS3/C#/SQL

Posted

add System.out.println("Debug"); somewhere in that function. If the console spews out "Debug" but doesn't damage whatever it is supposed to, then you know there is a problem with attackentityfrom. But if it doesn't, then you are not using onEntityCollidedWithBlock right.

Posted

The only thing I can think of is that you have a messed up source code. I copy and pasted your exact code into my mod and it works fine. Are you absolutely sure that onEntityCollidedWithBlock is being called and then attackentityfrom is called but it doesn't work?

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.