Jump to content

chubel10

Members
  • Posts

    51
  • Joined

  • Last visited

Everything posted by chubel10

  1. 1.7.10 is not supported here anymore, I don't think you'll get support. Have a good one.
  2. Yes, like lIyemu said, you can use the getSpawns method for every biome. You can iterate through them all by using java stream. You can then to .add and add your entity. Allow me to show you an example: package <idk, whatever package name you want>; import <wherever you keep static references to your entities>; import net.minecraft.entity.EntityClassification; import net.minecraft.world.biome.Biome.SpawnListEntry; import net.minecraftforge.registries.ForgeRegistries; public class ModEntitySpawn { public static void spawnMobs() { ForgeRegistries.BIOMES.getValues().stream() //This is just some randsom filtering but do whatever you want her, or dont filter at all //if you want your entity to appear anywhere. .filter(biome -> biome.getRegistryName().toString().equals("minecraft:mushroom_fields") || biome.getRegistryName().toString().equals("minecraft:mushroom_fields_field_shore")) //this is the main dish .forEach(biome -> { biome.getSpawns(EntityClassification.<depends on what you want>) //min and max refer to number of entities in a group. .add(new SpawnListEntry(<static reference to your entity>, <weight>, <min>, <max>)); }); } } Then you have to register it in your event subscriber: @SubscribeEvent public static void onLoadSpawns (FMLCommonSetupEvent event) { ModEntitySpawn.spawnMobs(); } I hope this is helpful! good luck!
  3. Yes I understand your question and I can see 20k JSONs being overkill but if you see the vanilla code, that's pretty much the approach taken. For example, the clock item changes texture depending on the time of day in a gradual manner. The way vanilla goes about this can be seen in my attached image. Did you see it? yeah... it might seem like overkill (and it actually doesn't stop at 40, it goes up to 63) but that's how it's done. Datagens will reduce your workload a bunch and all you need to do then it preferably order your JSONs in folders in order to organize them. Good luck! I know this answer wasn't helpful but at least I hope its inspiring or idk haha.
  4. If you open your external dependencies, then go to client-extra.jar/data/minecraft/loot_tables you will find the vanilla examples. You can also look here https://minecraft.gamepedia.com/Loot_table for more information and intricacies (as Ugdhar already mentioned) The documentation is outdated in minecraftforge.net but the github one is much better (https://github.com/MinecraftForge/Documentation/tree/1.15.x) I hope this was helpful !
  5. Have you tried using blockbench? Maybe some tutorials on that would help
  6. Hello! I just wanted to ask if somebody could point me in the right direction in terms of making entity renderers. I'm just stuck in understanding stuff like the MatrixStack in the following code: I've also seen it be used with methods like push() and pop() in here https://github.com/mekanism/Mekanism/blob/1.15x/src/main/java/mekanism/client/render/entity/RenderFlame.java (not my code). I'm honestly just lost on whats happening or if I even need to understand it to make a renderer for my entity. Help would be greatly appreciated!
  7. Inside the definition for your entity renderer, did you @Override getEntityTexture() method in order to return your own ResourceLocation?
  8. Bump Oops. I just noticed I didn't attack the code right. Help would be appreciated (again). Thanks!
  9. Did you try looking at the vanilla implementation of the cauldron? it sounds pretty similar to what you want to do.
  10. So I created an entity that inherits from ZombiePigmanEntity and I've been able to replace the basic sounds like death and the like because they are inside methods that can be overritten. The problem is that the ENTITY_ZOMBIE_PIGMAN_ANGRY sound is inside a method that uses a bunch of other methods inside the class. This is problematic because if I override it I have to define the other functions it calls which basically means I have to overwrite everything. The alternative is inheriting directly from the parent ZombieEntity and copy-pasting the vanilla code inside the ZombiePigmanEntity and just change it to fit my mod (which I think is better). Is there a less messy way to do this? I wish I could just override an if statement within a method but I guess that's life hahaha. This is the code for ZombiePigmanEntity: [remove copyrighted code - diesieben07] The method that is giving me trouble is the updateAITasks() one. Help would be greatly appreciated!
  11. I was just wondering where I can find the .json files and the .ogg in the minecraft code. I'm in eclipse and I searched in client-extra.jar but didn't have any luck Help would be appreciated. Thanks in advance!
  12. Thank you for the replies. I wouldn't have expected that the answers to my (many) questions would lie in getting sleep and not giving up but then again, that really is what it comes down to huh? Again, thanks!
  13. So by reading source someone can figure out what to do by themselves to a certain extent right? But when source code fails you, the documentation can tell you all about registries and the like. The problem is that there are things that are necessary like the .json files for models and recipes which are not mentioned in the documentation and can only be seen in tutorials which can only take you so far, especially when working with newer and newer versions which will make past tutorials obsolete. In other words, tutorials are slightly bad practice (?) My question is, is there a possible way for me to know about stuff like this (the .json files) without having to look at tutorials? Or can I access the vanilla .json files to see how they do it? And if so, how could I know that that is something I'm missing if no errors are shown and normal source code navigation can't take you there because they're not referenced? Sorry for the long post but replies to this would be much obliged!
  14. This tutorial should help you set up you workspace nicely. https://cadiboo.github.io/tutorials/1.15.1/forge/ (Not owned by me by the way but by user cadiboo)
  15. Just for the sake of extra help, When you import something to your mod code you can use eclipse to navigate to the package you imported something from. Basically if you ever import something like blocks (and you automatically imported it) from the Minecraft source code, then you can go to where that import is at the top of the file and navigate through there by clicking and double clicking around. Additionally, you can click on any method anywhere in the source code for minecraft or for forge and wait for it to highlight and then right-click (which brings up a very nice menu) and find where it is declared and also any instances of it in other files —along with other stuffs. I hope this is of use!
  16. Thank you both! reading the source is actually surprisingly fun, haha.
  17. Thanks for the reply! My question was more like if anyone had some tips on how to use eclipse-related tools and general navigation things that make reverse engineering easier (like command clicking a method to go to its definition and that kind of stuff) Thanks in advance!
  18. I'm a beginner modder and a concept seems to keep popping up due to its importance is reading the source code. I have also hear it being called "reverse engineering". Is there a guide or could someone help me not get lost in the giant sea that source code can be? Additionally, I'm using eclipse by the way and it seems like the file search feature does not search stuff in external dependencies (where the minecraft source code is). Am I missing something? Help would be greatly appreciated. Thanks.
  19. All of my problems were caused by typos. Sorry for wasting your time.
  20. Do I only need to register a serializer for stuff like custom GUIs? because I just want to use the crafting table as usual but with my modded items. Is a custom recipe class even necessary?
  21. I have no idea why but I just changed it to drop something else and it did! I just changed it back and now it is dropping the ore itself, thank you!. Is there a chance you could help me locate where in your mod you registered your recipe serializers for custom your recipes? Thanks again.
  22. 1) I'll look into this because I don't know what you mean first-hand. Thanks 2) Okay good, thank you for narrowing down the debugging process for me by a couple hours, haha. 3) Okay so, I've been follow Cadiboo's example mod. And so I made a package called data.<modid>.loot_tables.blocks inside the resources package. Inside it I made the <ore name>.json file for an ore I created and the code inside it is: { "pools": [ { "rolls": 1, "entries": [ { "type": "item", "name": "<modid>:<ore name>", "weight": 1, "functions": [ { "function": "set_data", "data": 0 } ] } ] } ] } Which I got from a data generator I found for loot tables I did replace everything inside <>s to whatever was necessary for my own mod but the ore still doesn't drop itself. The thing I tried was just copy the loot_table into ./assets instead of ./data but that didn't work either. Thanks in advance
  23. I found the source code but I don't find any .json files, I've only found stuff about the definition for crafting recipes inside the ./item/crafting package. Regarding the loot tables, my blocks aren't dropping anything and I already used the data generators in order to avoid problems. I have seen some people calling some sort of register method for the recipes and also for the loot tables but I have seen others they they should load automatically once you place them in data/<modid>/loot_tables/blocks or data/<modid>/recipes. I tried the "LootTableList.register(new ResourceLocation("modid", "loot_table_name"))" approach from the documentation but LootTableList is not defined. I also tried putting it inside assets instead of data but nothing it working. Thank for your help.
  24. I hope this link can help! https://minecraft.gamepedia.com/Model
  25. Thanks you for the reply! I'll look into the data generators. Also, how can I take a look into how minecraft and forge do stuff? should I read the source code or are there documentations for stuff like that? Thanks in advance!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.