Posted April 20, 20169 yr I am trying to create a custom villager. I am using the registry system, so I create the proffession first String sage = Const.MODRES+"textures/entity/villager/elder.png"; elderProfession = new VillagerProfession(Const.MODRES+"elder", sage){ @Override public ResourceLocation getSkin() { return sageTexture; } }; Then I add the career which has the trades new VillagerCareer(elderProfession, "sage_career"){ @Override public ITradeList[][] getTrades(){ return sageTrades; } }; Now the trades work just fine, the villager spawns when i do /summon Villager ~ ~ ~ {Profession:5,Career:0} it also spawns naturally with eggs or breeding. But the skin does not register. I looked into EntityVillager.java and see this public int getProfession() { return Math.max(((Integer)this.dataWatcher.get(PROFESSION)).intValue() % 5, 0); } So in other words the %5 sets the maximum limit of 4, its treating ALL villagers registered using forge as profession zero which is farmer. Is there any forge way to do this without relying on reflection or something to override this vanilla method? I know that [a different modder] on twitter fixed this with a core mod, but i want to do this the 'right' way. Full Code: https://github.com/PrinceOfAmber/CyclicMagic/blob/master/src/main/java/com/lothrazar/cyclicmagic/registry/VillageTradeRegistry.java http://www.curse.com/users/Lothrazar/projects
April 20, 20169 yr The %4 is in there to prevent vanilla from crashing. We need to move the texture getter from using getProfession to getProfessionForge As for the person who 'fixed' it with a coremod, they an die in a fucking fire. I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
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.