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

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 ?

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.

  • Author

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.

  • Author

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

  • Author
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

  • Author
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

  • Author
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

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.

  • Author
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

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.

  • Author
8 hours ago, Draco18s said:

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

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

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 :)

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

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.