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.

We can modify existing mob behavior right? Forge docs don't talk about entities at all

Featured Replies

Posted

I am brand new to modding Minecraft.  I plan on doing only entity stuff like modding the AI for example.  Unfortunately the forge docs are VERY lacking right now on how to really do much.  It doesn't even have an entity section.  Before I dive into hours of code review, debugging and running tests, can someone tell me real quick if we can mod existing behavior?  I even have an exact example:

 

Take EntityLiving.java, method:

protected void despawnEntity()

 

This is the code that despawns entities if they are too far from the player.  How can I change this behavior to make the despawn rules different?  It is easy right?  Any quick pointers?

 

 

  • Author

OK thanks.  Yes, I started looking at the mineforge codebase and see its got a ton of event handlers.  I will start with these.  I am reading/assuming that these events intercept game actions and can even cancel them if you set the cancel flag.  I'll dive in from here.

 

Yes. For modifying vanilla behavior you can first look for public fields and methods. For example entity AI is contained in a public list that you can modify directly. After that look at Forge events. Also some vanilla behaviour such as loot tables, achievements, recipes, models, etc., is now defined by JSON asset files.. If those aren't sufficient then look at java reflection to access otherwise private fields and methods.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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.