-
Notifications
You must be signed in to change notification settings - Fork 111
Add override for Block.entityInside #1080
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
base: main
Are you sure you want to change the base?
Conversation
ChiefArug
left a comment
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.
Good idea for another callback!
| import net.minecraft.world.level.Level; | ||
| import net.minecraft.world.level.block.state.BlockState; | ||
|
|
||
| public class EntityInsideBlockCallback extends EntitySteppedOnBlockCallback { |
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.
I don't like this inheritance tree. It makes no sense conceptually, and if Mojang add a new parameter to stepped on then it will need reworking. Maybe instead rename EntitySteppedOnBlockCallback to a more generic 'EntityBlockCallback' and use that directly in both places?
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.
This class doesn't need to exist if all it doesn't do anything its superclass does.
| @Info(""" | ||
| Set what happens when an entity is inside the block | ||
| This is called every tick for every entity inside the block, so be careful what you do here. | ||
| This will never be called if the block is a solid full cube. |
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.
Does this hold even when an entity is suffocating in the block?
Description
Allows customizing what happens to an entity when they are inside a custom block.
This allows for the creation of things like poison ivy or toxic liquids.
Example Script
Other details