Jump to content

[1.15.2] Block interactions deprecation


QuantumSoul

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.