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,

 

What I want to do is to remove a Mob (Ghasts for example) when a world is created. I tried different things, I know how to code in C and I understand most of Java, but I don't understand everything in all the code I read from various topics in different forums. That is why I'm coming here to seek help. 

 

The last thing I tried is this:

Quote

@SubscribeEvent
    public void onEntityJoinWorld(EntityJoinWorldEvent event)
    {
        Entity entity = event.getEntity();

        if (entity instanceof EntityPigZombie)
        {
            event.getWorld().removeEntity(entity);
            event.setCanceled(true);
            
        }
    }

 

I put this method in my Main class and I wanted to test this with the Zombie Pigman. (My Mod loads perfectly for 1.12, I followed a tutorial on YouTube to set this up and create blocks and items. But I want to do something else like remove a specific mobs.)

 

I thank you in advance for reading this topic and for your help.

  • 3 weeks later...

1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

  • Guest locked this topic
Guest
This topic is now closed to further replies.

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.