Skip to content

Conversation

@Jishuna
Copy link

@Jishuna Jishuna commented Dec 5, 2025

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

// Kills any entity that steps into the block.
StartupEvents.registry('block', event => {
     event.create('test')
     .noCollision()
     .entityInside(callback => {
        callback.entity.setHealth(0);
     });
});

Other details

Copy link
Contributor

@ChiefArug ChiefArug left a 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 {

This comment was marked as resolved.

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants