Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add onEntityCollide function when entity are above a block #6347
base: minor-next
Are you sure you want to change the base?
Add onEntityCollide function when entity are above a block #6347
Changes from 15 commits
961dbd0
9f5ced2
b1b0a64
4b12957
2e459a7
9927ab1
9bcfa65
b8df873
2361021
50da8c5
9c1fecb
708d713
b123133
fbd0d02
c9339f9
9a4257d
06f4525
b3f59f8
ed3f49a
8ef46a8
a78e8dd
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this different for the Y axis than X/Z?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially, I started testing with 0.001 for each axis but I found a bug on the Y axis with a slab. Indeed, if you put a block of magma under a slab and a player steps on this slab, with 0.001 on the Y axis, the collision is not detected so I put 0.1 to detect it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't make any sense. Is magma supposed to hurt you from underneath a slab? And if it is, why does 0.1 make a difference since the BB of a slab is 0.5 thick?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After some reseach, player take damage on magma block if block between player and magma block has AABB below or equal to 13/16 like trapdoor (https://minecraft.wiki/w/Magma_Block#Damage). So the y value is 1-13/16 = 3/16.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then it seems like a collide function isn't appropriate for this. We need something more like onEntityNearby() or onEntityAdjacent().