Jump to content

Recommended Posts

Posted

Hi,

I wanted to override

Block#onBlockActivated
Block#onEntityCollision

But the first one doesn't exist anymore and the second one is deprecated and never called

 

What should I do ?

Posted

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

I already checked those links, they say you should still override them

but I can't override onBlockActivated because it's not in my IDE anymore.

And I did override onEntityCollision but it's never called.

Posted

OnBlockActivated: The Override is underlined

    @Override
    public void onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player)
    {}

 

OnEntityCollison: The player never moves

    @Override
    public void onEntityCollision(BlockState state, World worldIn, BlockPos pos, Entity entityIn)
    {
        entityIn.setMotion(0, 10, 0);
	}

 

I'm using forge 31.1.1

Posted
2 minutes ago, diesieben07 said:

Yes, because the method signature is wrong.

Use your IDE to override method, don't just blindly type random parameters in. You have an IDE for a reason. Use it!

I tried but it's not in the list. I think it's because of my forge version

 

Quote

Put a breakpoint there. Is it hit?

Oops you're right

Posted (edited)
48 minutes ago, diesieben07 said:

What matters is also the MCP mappings version.

Update your build.gradle to use the values from latest MDK.

Should I just change the

Dependencies {
    minecraft ''
}

?

 

EDIT: I did a new project folder and it worked

Edited by QuantumSoul
Solved
Posted
2 hours ago, diesieben07 said:

And like... writing this code, seeing it not do what you want and concluding "the method must never be called" is completely bananas. That is not how you debug something. Put a breakpoint there. Is it hit?

I put a breakpoint and it's never called

Posted

onEntityCollission is only called for blocks that the player can actually be inside of, so blocks that take up the full 1x1x1 cube (and are solid) have no space for the player to actually "enter" it.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted (edited)
22 hours ago, Draco18s said:

onEntityCollission is only called for blocks that the player can actually be inside of, so blocks that take up the full 1x1x1 cube (and are solid) have no space for the player to actually "enter" it.

What can I do then, except resizing the block ?

 

EDIT: I guess I should use an event but I couldn't find which one

Edited by QuantumSoul
Posted
1 hour ago, QuantumSoul said:

except resizing the block ?

Nothing, because Minecraft does not make the check for blocks the player is rubbing their face on.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
1 hour ago, QuantumSoul said:

Isn't there an event for when the player move ?

I think we need to go back a step, and have you describe what you are trying to accomplish, from a gameplay (not programming) point of view. Then knowing what the actual question is, we can find a suitable answer :)

Posted (edited)
1 hour ago, Ugdhar said:

I think we need to go back a step, and have you describe what you are trying to accomplish, from a gameplay (not programming) point of view. Then knowing what the actual question is, we can find a suitable answer :)

It's a full block and I want to use it's four sides as a ladder and it's down side as a way to "magnet" player's head to travel horizontally. It has to be a full block since it is generated by clusters

Edited by QuantumSoul

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.