Jump to content

Recommended Posts

Posted (edited)

So, I’ve been dabbling a bit with forge, and I’m trying to make a mod for 1.16.5 that adds various new cat textures, in addition to some other features.

 

However, the issue I’m running into is how exactly to create these variations. I would like to have various items, when interacted with a tamed cat to change the CatType tag (I’ve done this much on my own, and it works).

This being said, I want to add my new cat textures as new CatTypes, so that the texture data is properly stored in each entity instance. I, however, even after examining the cat and wolf files, can’t seem to figure out how I could add more variants via these NBT tags.


Is this the way I should be doing this, or is there a much easier approach I should be taking?

 

Thanks in advance.

 

EDIT:

I seem to have found the spot within CatEntity.java that contains the code for randomly choosing a CatType when a CatEntity is spawned. Line 348 at finalizespawn contains helped me understand how textures are randomly chosen. However, I assume that somewhere there is a json mapping (or something similar) that maps each number CatType to a filepath for the texture, similar to how you would use a lang file to properly format localizations of items or tab labels for your mod.

 

I don't really care about being able to randomly generate the new cat textures (CatTypes) in the world, I just want to have the additional CatType Mapping. (EX: CatType 12, 13, 14, etc.) "mapped" correctly to the location of the textures included in the assets folder of my mod. I'm not sure where/what to do in order to add these additional types, as I assume I'd need to override some sort of vanilla mapping or file, but I'm really not sure. I have an idea of WHAT I need to do, but I'd really appreciate any help on locating WHERE / HOW to do it, as this is my first real attempt at modding Minecraft.

Edited by Splurpy_
Adding more relevant information / Reformatting Title
  • Splurpy_ changed the title to [1.16.5] Adding more possible CatTypes to CatEntity
Posted

Okay so, thought I'd leave a reply as to not make the initial post any longer.

Not sure how much help I'll really get because this seems so niche, so I'll just document my progress for now.

 

I somehow completely missed this the first time around. I found the map that connects the textures to CatType in EntityCat.java, but now I just need to figure out how I can override/add my own mappings with textures to this list, especially since it's static. A link to the code I'm referring to is below.

CatType Texture Map

Posted (edited)

To my understanding, there's no way to change an immutable object (public static final Map), so it seems like my main options are going to be:

  1. Completely override the old EntityCat from the game, by extending a custom entity class that is the exact same but with more texture mappings (I really hope I DON'T have to do this).
  2. Create a class which overrides getResourceLocation to look for textures from a different Map (I'm not sure how to implement this, but it seems like the best way to go, and it seems MUCH easier, but I don't know where to start).

On that note, is it possible to override/modify methods for pre-existing/Vanilla classes?

Edited by Splurpy_
Adding relevant question
Posted (edited)
  On 4/14/2022 at 11:42 PM, poopoodice said:

Access Transformers allows you do get rid of the final modifier.

Expand  

Could you maybe explain a little bit more? I'm not sure what you mean by "get rid of the final modifier".

From what I can see, it allows using "smaller-scope" methods out of their localized scopes? Or am I misunderstanding?

 

EDIT: NEVERMIND, just realized you meant the literal "final" modifier of public static final. Thanks!

Edited by Splurpy_
i'm dumb
Posted (edited)

One new issue I'm finding is how to actually use the transformer in the accesstransformer.cfg file within META-INF.

 

I understand that I need the MojMap (I think) in order to do this, but I don't know where to get/how to format the map for this specific field.

Is it as simple as:

public-f net.minecraft.entity.passive.CatEntity TEXTURE_BY_TYPE

 

Because I tried this, and it didn't actually seem to affect the "public static final" aspect within CatEntity.java, even after refreshing the build.gradle.

 

Any help is greatly appreciated!

 

EDIT:

I was actually able to use my IDE to get the AT value, so now I have:

public-f net.minecraft.entity.passive.CatEntity field_213425_bD # TEXTURE_BY_TYPE

This, however, still doesn't change anything in the source code. I'm not sure if it's supposed to or not. It's kind of difficult to find a lot on ATs.

Should I be able to redefine the field from another class, or am I missing the point?

Edited by Splurpy_
New info
Posted (edited)
  On 4/15/2022 at 7:52 AM, poopoodice said:

You need to specify the AT file in your build.gradle, and reimport/refresh the gradle.

Expand  

I did this, but nothing seems to have updated.

I've typed:

 accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

And even after refreshing the gradle, nothing changes.

Edited by Splurpy_
Posted

I've redefined the field inside the item that's supposed to change them, but when I call setCatType(), it randomly selects a new integer if its anything larger than the predefined method's bound.

I'm a little new to Forge, so any tips on how to go about dealing with this?

Posted (edited)
  On 4/15/2022 at 1:49 PM, Splurpy_ said:

I'm a little new to Forge, so any tips on how to go about dealing with this?

Expand  

this is not possible (with Mixin yes), the only solution for this is to replace the CatRenderer
unfortunately i never done this before so no idea what exactly you need to do

Edited by Luis_ST
Posted
  On 4/15/2022 at 7:06 PM, diesieben07 said:

There is no way to safely add new types to the exiting cat entity, as they are using hardcoded integer IDs. Do not attempt this, it will cause nothing but trouble.

Make your own entity based on CatEntity.

Expand  

Okay thanks. Is this as easy as simply extending CatEntity, and then modifying the new class?

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • [06Apr2025 14:20:17.918] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--username, {MINECRAFT_USERNAME}, --version, 1.20.1, --gameDir, C:\Users\{COMPUTER_USERNAME}\AppData\Roaming\ModrinthApp\profiles\dude whatttt, --assetsDir, C:\Users\{COMPUTER_USERNAME}\AppData\Roaming\ModrinthApp\meta\assets, --assetIndex, 5, --uuid, {MINECRAFT_UUID}, --accessToken, ????????, --clientId, c4502edb-87c6-40cb-b595-64a280cf8906, --xuid, 0, --userType, msa, --versionType, release, --width, 854, --height, 480, --launchTarget, forgeclient, --fml.forgeVersion, 47.4.0, --fml.mcVersion, 1.20.1, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20230612.114412] [06Apr2025 14:20:17.923] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 10.0.9+10.0.9+main.dcd20f30 starting: java version 17.0.10 by Azul Systems, Inc.; OS Windows 11 arch amd64 version 10.0 [06Apr2025 14:20:19.188] [main/INFO] [net.minecraftforge.fml.loading.ImmediateWindowHandler/]: Loading ImmediateWindowProvider fmlearlywindow [06Apr2025 14:20:19.242] [main/INFO] [EARLYDISPLAY/]: Trying GL version 4.6 [06Apr2025 14:20:19.405] [main/INFO] [EARLYDISPLAY/]: Requested GL version 4.6 got version 4.6 [06Apr2025 14:20:19.434] [main/INFO] [mixin-transmog/]: Mixin Transmogrifier is definitely up to no good... [06Apr2025 14:20:19.450] [main/INFO] [mixin-transmog/]: crimes against java were committed [06Apr2025 14:20:19.463] [main/INFO] [mixin-transmog/]: Original mixin transformation service successfully crobbed by mixin-transmogrifier! [06Apr2025 14:20:19.495] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=union:/C:/Users/{COMPUTER_USERNAME}/AppData/Roaming/ModrinthApp/profiles/dude%20whatttt/mods/Connector-1.0.0-beta.46+1.20.1.jar%23361%23364!/ Service=ModLauncher Env=CLIENT [06Apr2025 14:20:19.505] [pool-2-thread-1/INFO] [EARLYDISPLAY/]: GL info: NVIDIA GeForce RTX 2060/PCIe/SSE2 GL version 4.6.0 NVIDIA 572.83, NVIDIA Corporation [06Apr2025 14:20:20.213] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\{COMPUTER_USERNAME}\AppData\Roaming\ModrinthApp\meta\libraries\net\minecraftforge\fmlcore\1.20.1-47.4.0\fmlcore-1.20.1-47.4.0.jar is missing mods.toml file [06Apr2025 14:20:20.216] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\{COMPUTER_USERNAME}\AppData\Roaming\ModrinthApp\meta\libraries\net\minecraftforge\javafmllanguage\1.20.1-47.4.0\javafmllanguage-1.20.1-47.4.0.jar is missing mods.toml file [06Apr2025 14:20:20.219] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\{COMPUTER_USERNAME}\AppData\Roaming\ModrinthApp\meta\libraries\net\minecraftforge\lowcodelanguage\1.20.1-47.4.0\lowcodelanguage-1.20.1-47.4.0.jar is missing mods.toml file [06Apr2025 14:20:20.222] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\{COMPUTER_USERNAME}\AppData\Roaming\ModrinthApp\meta\libraries\net\minecraftforge\mclanguage\1.20.1-47.4.0\mclanguage-1.20.1-47.4.0.jar is missing mods.toml file [06Apr2025 14:20:20.702] [main/WARN] [net.minecraftforge.jarjar.selection.JarSelector/]: Attempted to select two dependency jars from JarJar which have the same identification: Mod File:  and Mod File: . Using Mod File:  [06Apr2025 14:20:20.704] [main/WARN] [net.minecraftforge.jarjar.selection.JarSelector/]: Attempted to select a dependency jar for JarJar which was passed in as source: geckolib. Using Mod File: C:\Users\{COMPUTER_USERNAME}\AppData\Roaming\ModrinthApp\profiles\dude whatttt\mods\geckolib-forge-1.20.1-4.7.1.2.jar [06Apr2025 14:20:20.704] [main/WARN] [net.minecraftforge.jarjar.selection.JarSelector/]: Attempted to select a dependency jar for JarJar which was passed in as source: midnightlib. Using Mod File: C:\Users\{COMPUTER_USERNAME}\AppData\Roaming\ModrinthApp\profiles\dude whatttt\mods\midnightlib-forge-1.4.2.jar [06Apr2025 14:20:20.704] [main/WARN] [net.minecraftforge.jarjar.selection.JarSelector/]: Attempted to select a dependency jar for JarJar which was passed in as source: curios. Using Mod File: C:\Users\{COMPUTER_USERNAME}\AppData\Roaming\ModrinthApp\profiles\dude whatttt\mods\curios-forge-5.12.1+1.20.1.jar [06Apr2025 14:20:20.704] [main/WARN] [net.minecraftforge.jarjar.selection.JarSelector/]: Attempted to select a dependency jar for JarJar which was passed in as source: architectury. Using Mod File: C:\Users\{COMPUTER_USERNAME}\AppData\Roaming\ModrinthApp\profiles\dude whatttt\mods\architectury-9.2.14-forge.jar [06Apr2025 14:20:20.704] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.JarInJarDependencyLocator/]: Found 90 dependencies adding them to mods collection [06Apr2025 14:20:21.837] [main/INFO] [org.sinytra.connector.locator.DependencyResolver/]: Dependency resolution found 0 candidates to load [06Apr2025 14:20:23.246] [main/INFO] [org.sinytra.connector.service.hacks.ModuleLayerMigrator/]: Successfully made module authlib transformable  
    • [06Apr2025 14:20:17.918] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--username, {MINECRAFT_USERNAME}, --version, 1.20.1, --gameDir, C:\Users\{COMPUTER_USERNAME}\AppData\Roaming\ModrinthApp\profiles\dude whatttt, --assetsDir, C:\Users\{COMPUTER_USERNAME}\AppData\Roaming\ModrinthApp\meta\assets, --assetIndex, 5, --uuid, {MINECRAFT_UUID}, --accessToken, ????????, --clientId, c4502edb-87c6-40cb-b595-64a280cf8906, --xuid, 0, --userType, msa, --versionType, release, --width, 854, --height, 480, --launchTarget, forgeclient, --fml.forgeVersion, 47.4.0, --fml.mcVersion, 1.20.1, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20230612.114412] [06Apr2025 14:20:17.923] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 10.0.9+10.0.9+main.dcd20f30 starting: java version 17.0.10 by Azul Systems, Inc.; OS Windows 11 arch amd64 version 10.0 [06Apr2025 14:20:19.188] [main/INFO] [net.minecraftforge.fml.loading.ImmediateWindowHandler/]: Loading ImmediateWindowProvider fmlearlywindow [06Apr2025 14:20:19.242] [main/INFO] [EARLYDISPLAY/]: Trying GL version 4.6 [06Apr2025 14:20:19.405] [main/INFO] [EARLYDISPLAY/]: Requested GL version 4.6 got version 4.6 [06Apr2025 14:20:19.434] [main/INFO] [mixin-transmog/]: Mixin Transmogrifier is definitely up to no good... [06Apr2025 14:20:19.450] [main/INFO] [mixin-transmog/]: crimes against java were committed [06Apr2025 14:20:19.463] [main/INFO] [mixin-transmog/]: Original mixin transformation service successfully crobbed by mixin-transmogrifier! [06Apr2025 14:20:19.495] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=union:/C:/Users/{COMPUTER_USERNAME}/AppData/Roaming/ModrinthApp/profiles/dude%20whatttt/mods/Connector-1.0.0-beta.46+1.20.1.jar%23361%23364!/ Service=ModLauncher Env=CLIENT [06Apr2025 14:20:19.505] [pool-2-thread-1/INFO] [EARLYDISPLAY/]: GL info: NVIDIA GeForce RTX 2060/PCIe/SSE2 GL version 4.6.0 NVIDIA 572.83, NVIDIA Corporation [06Apr2025 14:20:20.213] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\{COMPUTER_USERNAME}\AppData\Roaming\ModrinthApp\meta\libraries\net\minecraftforge\fmlcore\1.20.1-47.4.0\fmlcore-1.20.1-47.4.0.jar is missing mods.toml file [06Apr2025 14:20:20.216] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\{COMPUTER_USERNAME}\AppData\Roaming\ModrinthApp\meta\libraries\net\minecraftforge\javafmllanguage\1.20.1-47.4.0\javafmllanguage-1.20.1-47.4.0.jar is missing mods.toml file [06Apr2025 14:20:20.219] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\{COMPUTER_USERNAME}\AppData\Roaming\ModrinthApp\meta\libraries\net\minecraftforge\lowcodelanguage\1.20.1-47.4.0\lowcodelanguage-1.20.1-47.4.0.jar is missing mods.toml file [06Apr2025 14:20:20.222] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\{COMPUTER_USERNAME}\AppData\Roaming\ModrinthApp\meta\libraries\net\minecraftforge\mclanguage\1.20.1-47.4.0\mclanguage-1.20.1-47.4.0.jar is missing mods.toml file [06Apr2025 14:20:20.702] [main/WARN] [net.minecraftforge.jarjar.selection.JarSelector/]: Attempted to select two dependency jars from JarJar which have the same identification: Mod File:  and Mod File: . Using Mod File:  [06Apr2025 14:20:20.704] [main/WARN] [net.minecraftforge.jarjar.selection.JarSelector/]: Attempted to select a dependency jar for JarJar which was passed in as source: geckolib. Using Mod File: C:\Users\{COMPUTER_USERNAME}\AppData\Roaming\ModrinthApp\profiles\dude whatttt\mods\geckolib-forge-1.20.1-4.7.1.2.jar [06Apr2025 14:20:20.704] [main/WARN] [net.minecraftforge.jarjar.selection.JarSelector/]: Attempted to select a dependency jar for JarJar which was passed in as source: midnightlib. Using Mod File: C:\Users\{COMPUTER_USERNAME}\AppData\Roaming\ModrinthApp\profiles\dude whatttt\mods\midnightlib-forge-1.4.2.jar [06Apr2025 14:20:20.704] [main/WARN] [net.minecraftforge.jarjar.selection.JarSelector/]: Attempted to select a dependency jar for JarJar which was passed in as source: curios. Using Mod File: C:\Users\{COMPUTER_USERNAME}\AppData\Roaming\ModrinthApp\profiles\dude whatttt\mods\curios-forge-5.12.1+1.20.1.jar [06Apr2025 14:20:20.704] [main/WARN] [net.minecraftforge.jarjar.selection.JarSelector/]: Attempted to select a dependency jar for JarJar which was passed in as source: architectury. Using Mod File: C:\Users\{COMPUTER_USERNAME}\AppData\Roaming\ModrinthApp\profiles\dude whatttt\mods\architectury-9.2.14-forge.jar [06Apr2025 14:20:20.704] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.JarInJarDependencyLocator/]: Found 90 dependencies adding them to mods collection [06Apr2025 14:20:21.837] [main/INFO] [org.sinytra.connector.locator.DependencyResolver/]: Dependency resolution found 0 candidates to load [06Apr2025 14:20:23.246] [main/INFO] [org.sinytra.connector.service.hacks.ModuleLayerMigrator/]: Successfully made module authlib transformable  
    • I have been trying to be Frankenstein and mix 2 modpacks together for my wife and I to both enjoy together. I downloaded both from curseforge, made a new modpack, shoved all of the mods in, and painstakenly went through all 300+ mods taking half of them out then slowly adding them in a handfull at a time until the game launched with as many mods as possible. I knew there were going to be some compatibility issues and have successfully gotten to the main menu. I went to create a new world and got the -1 crash report. I opened the report and took out the mods it said were incompatible until it no longer said anything more than... "// You're mean."  I am trying to understand this report as from what other people have said, it sounds like fabric is needed but I don't see how that's possible when both modpacks are the same version of minecraft, using forge, and work individually. I do see in there stuff like this in the crash report: Does this mean I have to go through what looks like 2/3s of all the mods in there and take them out? Or is there something else I'm missing? Please help This is the crash report:  https://paste.ee/p/E8dz1PCC        
    • I want to replace a villager with my custom mob when closing its' interface or punching it.  I got the check with the interface and punch but am missing the spawn method. I'm passing on the position of the trader but what do I need to use to set the position for the new mob + how do I even summon it? This is my first larger mod so please forgive me if thats a dumb question or it's missing information. 
  • Topics

×
×
  • Create New...

Important Information

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