Posted October 28, 20169 yr 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.
October 28, 20169 yr You can't override classes. See if theres an event that you can use to do what you want.
October 28, 20169 yr 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.
October 28, 20169 yr 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.
October 28, 20169 yr 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).
October 28, 20169 yr 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?
October 28, 20169 yr Author Alright, how do I get the number of villagers and other stats of a village to use in the event?
October 29, 20169 yr Author You access them from the Village class, which you seem to understand already. Yes but how do I get the private values for the villages?
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.