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

Hello fellow modders! It has been a while and I'm making a mod that improves villagers and villages. I'm currently at village.class and I'm wondering how to override the MC one with my own.

  • Author

Describe what you want to achieve, not how you intend to code it and we can help you.

In MC there is a class known as village.class which contains much of the village calculations. I'm trying to figure out how to replace the MC one with my own version of the file. The ideal end result is that the part of villages that are handled by MC village.class should be handled by mine.

  • Author

You again described how you intend to code things.

Let me give you an example:

 

Intended outcome: The player can no longer use their hands to mine dirt.

Intended way to code it: Use

PlayerEvent.HarvestCheck

.

 

Ah, I misunderstood. Players can use a config file to change the amount of iron golems can spawn.

  • Author

You can use

WorldTickEvent

and then manually spawn additional iron golems if needed.

 

Alright, sure I could use an event however I would like to modify (using a modified copy) the village.class file so I could easily change a variable in it (as my current task takes two variables, the min doors required and nu villagers required).

  • Author

You could make a modified copy, yes. But Minecraft would not care about it at all. The proper way to do what you want is to modify the existing behavior using events.

Alright, thanks. How would I use events to modify needed doors and needed villagers to spawn an iron golem?

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.