Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

Edited by Lennard Schilling
typo

  • Author
On 12/28/2022 at 4:51 PM, ChampionAsh5357 said:

You could deny the `EntityMobGriefingEvent` by setting the result, but you could also just disable mob griefing without the need for a mod.

Thanks, this event looks like what I'm looking for. Disabeling mob griefing in the settings would is not exactly what I want since it also removes the vilagers ability to consume food and it disables creeper block damage.

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...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.