Hi, I'm currently trying to develop a mod, that stops the enderman from picking up blocks. I know such a mod already exists but ist is too comprehensive for my tasta and also not suppurts my current minecraft version. Also I wanted to learn something about minecraft modding. This is my fist minecraft mod.
I want to create an eventhandler like this:
@SubscribeEvent
public void onEndermanPickUpBlock(PickUpLootEvent event) {
// Check if the entity picking up the block is an Enderman
if (event.getEntity() instanceof EndermanEntity) {
// Cancel the event to prevent the Enderman from picking up the block
event.setCanceled(true);
}
}
Sadly my informations seem to be outdated, since both the class EndermanEntity and the class PickUpLootEvent seem to have been renamed or removed completely in my current forge version 1.19.2-43.2.0
I also could not find a documentation, that would help me to find wout what happened to these classes. https://docs.minecraftforge.net/en/latest/ returns no results.
I found the class net.minecraft.world.entity.monster.EnderMan in the library files but I have no Idea what happened to the event. I hope someone can help me.