Jump to content

[1.12.2] custom entity/mob | missing spawnegg [Solved]


DeBugger

Recommended Posts

Hey guys,

Im very new to modding, especially in creating mobs. I tried to create one, but Im missing the spawnegg. I used a tutorial to create it.

I hope that anybody can help me. For development I use Forge-1.12.2-14.23.4.2705-mdk.

DeBugger (probably not a debugger ;D)

 

PS:

I dont have advanced Java kowledge. I hope thats okay and enough ;)

EntityInit:

Spoiler

package com.cb.cyborg.init;

import com.cb.cyborg.Main;
import com.cb.cyborg.entity.EntityCyborg1;
import com.cb.cyborg.util.Reference;

import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.registry.EntityRegistry;

public class EntityInit
{
    public static void registerEntities()
    {
        registerEntity("cyborg1", EntityCyborg1.class, Reference.ENTITY_CYBORG1, 50, 2434341, 14079702);
    }
    
    private static final void registerEntity(String name, Class<? extends Entity> entity, int id, int range, int color1, int color2)
    {
        EntityRegistry.registerModEntity(new ResourceLocation(Reference.MOD_ID + ":" + name), entity, name, id, Main.instance, range, 1, true, color1, color2);
    }

}

 

EntityCyborg1:

Spoiler

package com.cb.cyborg.entity;

import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.world.World;

public class EntityCyborg1 extends EntityZombie
{

    public EntityCyborg1(World worldIn)
    {
        super(worldIn);
    }

}

 

Edited by DeBugger
Link to comment
Share on other sites

Sorry that Im not very good informed about modding. Do I have to set a creativetab for the spawnegg? I registered now the spawnegg and the entity in different methods:

Spoiler

public static void registerEntities()
    {
        registerEntity("cyborg1", EntityCyborg1.class, Reference.ENTITY_CYBORG1, 50);
        registerEgg("cyborg1", 0x2F8A9F, 0x2F8A9F);
    }
    
    private static final void registerEntity(String name, Class<? extends Entity> entity, int id, int range)
    {
        EntityRegistry.registerModEntity(new ResourceLocation(Reference.MOD_ID + ":" + name), entity, name, id, Main.instance, range, 1, true);
    }
    
    private static final void registerEgg(String name, int color1, int color2)
    {
        EntityRegistry.registerEgg(new ResourceLocation(Reference.MOD_ID + ":" + name), color1, color2);
    }

Its still not working. Eclipse dont highlight any errors. Only two lines in consoles log make me worried:
 

Attempting connection with missing mods [minecraft, mcp, FML, forge, cb] at CLIENT

Attempting connection with missing mods [minecraft, mcp, FML, forge, cb] at SERVER

Are this messages important for my problem?

Link to comment
Share on other sites

9 minutes ago, DeBugger said:

cb

cb is a terrible modid.

 

9 minutes ago, DeBugger said:

EntityRegistry

Do not use EntityRegistry. Use RegistryEvent.Register<EntityEntry> and build EntityEntries using EntityEntryBuilder similar to how I do here.

 

Apart from that everything looks correct to me. Put a breakpoint in your registerEntities method and see if it is executed at all.

Link to comment
Share on other sites

No, I use it to call clinit and make the data parameters of the entities initialize so both the client and the server are aware of them. I've had an issue with the client not having the parameters initialized and the corresponding client->server connection crashes. This is just a hacky fix I've implemented to solve that problem.

Link to comment
Share on other sites

Okay, so far MC crahes with the excpetion:

Caused by: java.lang.IllegalArgumentException: Method public static void com.cb.cyborg.util.handlers.RegistryHandler.preInitRegistries() has @SubscribeEvent annotation, but requires 0 arguments.  Event handler methods must require a single argument.

But I need the arguments

RegistryEvent.Register<EntityEntry> event

?. I have no clue how to make it work. Sorry, Im (very) basic in Java and modding.

Link to comment
Share on other sites

Thank you for the link. Isnt this my EventHandler/Listener?:

RegistryHandler:

Spoiler

@SubscribeEvent
    public static void onEntitiesRegistry(RegistryEvent.Register<EntityEntry> event)
    {
        EntityInit.instance.registerEntities(event);
    }

And here the method in EntityInit:

Spoiler

public static void registerEntities(RegistryEvent.Register<EntityEntry> event)
    {
        event.getRegistry().registerAll(
        EntityEntryBuilder.create().entity(EntityCyborg1.class).name("cyborg1").id(Reference.MOD_ID + ":cyborg1", Reference.ENTITY_CYBORG1).tracker(50, 1, true).build());

    }

 

Link to comment
Share on other sites

6 minutes ago, DeBugger said:

        EntityInit.instance.registerEntities(event);

 

6 minutes ago, DeBugger said:

public static void registerEntities(RegistryEvent.Register<EntityEntry> event)

If the method is static you don't need an instance to invoke it. This is basic java.

 

As long as RegistryHandler is subscribed to the event bus this will work, yes.

  • Thanks 1
Link to comment
Share on other sites

I think that I now know my failure: my preInitRegistries SubscribeEvent dont contain an argument.

Spoiler

@SubscribeEvent
    public static void preInitRegistries()
    {
        RenderHandler.registerEntityRenders();
    }

It also is logged in the console.

Link to comment
Share on other sites

Okay, I corrected the failure. MC doesnt crash anymore, but I still dont have a spawnegg. I summoned the mob per command, and a "Zombie" were summoned. Now I have three problems:

  1. Zombie has default zombie-texture
  2. no spawnegg
  3. custom mob-model isnt used
Edited by DeBugger
Link to comment
Share on other sites

13 minutes ago, DeBugger said:

Okay, I corrected the failure. MC doesnt crash anymore, but I still dont have a spawnegg. I summoned the mob per command, and a "Zombie" were summoned. Now I have two problems:

  1. Zombie has default zombie-texture
  2. no spawnegg

What do you mean no spawn egg? does it exist with /give? please post your logs & your EntityCyborg class

 

Register your egg inside the builder.

Have a look at https://github.com/Cadiboo/WIPTechAlpha/blob/28bbf1ca75d6a02445838c3f4742a80ee6adc7f7/src/main/java/cadiboo/wiptech/EventSubscriber.java#L280-L290 for an example. 

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

Log:

Spoiler

2018-09-02 15:33:27,429 main WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
[15:33:27] [main/INFO]: Extra: []
[15:33:27] [main/INFO]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/User K/.gradle/caches/minecraft/assets, --assetIndex, 1.12, --accessToken{REDACTED}, --version, 1.12.2, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
[15:33:27] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[15:33:27] [main/INFO]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[15:33:27] [main/INFO]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
[15:33:27] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
[15:33:27] [main/INFO]: Forge Mod Loader version 14.23.4.2705 for Minecraft 1.12.2 loading
[15:33:27] [main/INFO]: Java is Java HotSpot(TM) Client VM, version 1.8.0_151, running on Windows 10:x86:10.0, installed at C:\Program Files (x86)\Java\jre1.8.0_151
[15:33:27] [main/ERROR]: Apache Maven library folder was not in the format expected. Using default libraries directory.
[15:33:27] [main/ERROR]: Full: C:\Users\User K\.gradle\caches\modules-2\files-2.1\org.apache.maven\maven-artifact\3.5.3\7dc72b6d6d8a6dced3d294ed54c2cc3515ade9f4\maven-artifact-3.5.3.jar
[15:33:27] [main/ERROR]: Trimmed: c:/users/User k/.gradle/caches/modules-2/files-2.1/org.apache.maven/maven-artifact/3.5.3/
[15:33:28] [main/INFO]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[15:33:28] [main/INFO]: Ignoring missing certificate for coremod FMLCorePlugin (net.minecraftforge.fml.relauncher.FMLCorePlugin), we are in deobf and it's a forge core plugin
[15:33:28] [main/INFO]: Ignoring missing certificate for coremod FMLForgePlugin (net.minecraftforge.classloading.FMLForgePlugin), we are in deobf and it's a forge core plugin
[15:33:28] [main/INFO]: Searching C:\Users\User K\Desktop\Mod_Workspaces\1.12\Cyborg\run\.\mods for mods
[15:33:28] [main/INFO]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
[15:33:28] [main/INFO]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin
[15:33:28] [main/INFO]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
[15:33:28] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[15:33:28] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[15:33:28] [main/INFO]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[15:33:28] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[15:33:28] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[15:33:28] [main/INFO]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
2018-09-02 15:33:28,684 main WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2018-09-02 15:33:29,185 main WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
[15:33:31] [main/ERROR]: FML appears to be missing any signature data. This is not a good thing
[15:33:31] [main/INFO]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[15:33:31] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[15:33:32] [main/INFO]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[15:33:32] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
[15:33:32] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
[15:33:32] [main/INFO]: Launching wrapped minecraft {net.minecraft.client.main.Main}
[15:33:33] [main/INFO]: Setting user: Player349
[15:33:39] [main/WARN]: Skipping bad option: lastServer:
[15:33:39] [main/INFO]: LWJGL Version: 2.9.4
[15:33:40] [main/INFO]: -- System Details --
Details:
    Minecraft Version: 1.12.2
    Operating System: Windows 10 (x86) version 10.0
    Java Version: 1.8.0_151, Oracle Corporation
    Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
    Memory: 876817632 bytes (836 MB) / 1046937600 bytes (998 MB) up to 1046937600 bytes (998 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML:
    Loaded coremods (and transformers):
    GL info: ' Vendor: 'Intel' Version: '4.3.0 - Build 20.19.15.4835' Renderer: 'Intel(R) HD Graphics 4400'
[15:33:40] [main/INFO]: MinecraftForge v14.23.4.2705 Initialized
[15:33:40] [main/INFO]: Starts to replace vanilla recipe ingredients with ore ingredients.
[15:33:40] [main/INFO]: Replaced 1036 ore ingredients
[15:33:41] [main/INFO]: Searching C:\Users\User K\Desktop\Mod_Workspaces\1.12\Cyborg\run\.\mods for mods
[15:33:43] [Thread-3/INFO]: Using sync timing. 200 frames of Display.update took 241523947 nanos
[15:33:43] [main/INFO]: Forge Mod Loader has identified 5 mods to load
[15:33:44] [main/INFO]: Attempting connection with missing mods [minecraft, mcp, FML, forge, cb] at CLIENT
[15:33:44] [main/INFO]: Attempting connection with missing mods [minecraft, mcp, FML, forge, cb] at SERVER
[15:33:45] [main/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Cyborg
[15:33:45] [main/INFO]: Processing ObjectHolder annotations
[15:33:45] [main/INFO]: Found 1168 ObjectHolder annotations
[15:33:45] [main/INFO]: Identifying ItemStackHolder annotations
[15:33:45] [main/INFO]: Found 0 ItemStackHolder annotations
[15:33:45] [main/INFO]: Configured a dormant chunk cache size of 0
[15:33:45] [Forge Version Check/INFO]: [forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
[15:33:45] [main/INFO]: Applying holder lookups
[15:33:45] [main/INFO]: Holder lookups applied
[15:33:45] [main/INFO]: Applying holder lookups
[15:33:45] [main/INFO]: Holder lookups applied
[15:33:45] [main/INFO]: Applying holder lookups
[15:33:45] [main/INFO]: Holder lookups applied
[15:33:46] [main/INFO]: Applying holder lookups
[15:33:46] [main/INFO]: Holder lookups applied
[15:33:46] [main/INFO]: Injecting itemstacks
[15:33:46] [main/INFO]: Itemstack injection complete
[15:33:46] [Forge Version Check/INFO]: [forge] Found status: UP_TO_DATE Target: null
[15:33:50] [Sound Library Loader/INFO]: Starting up SoundSystem...
[15:33:50] [Thread-5/INFO]: Initializing LWJGL OpenAL
[15:33:50] [Thread-5/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[15:33:51] [Thread-5/INFO]: OpenAL initialized.
[15:33:51] [Sound Library Loader/INFO]: Sound engine started
[15:33:58] [main/INFO]: Max texture size: 8192
[15:33:59] [main/INFO]: Created: 512x512 textures-atlas
[15:34:02] [main/INFO]: Applying holder lookups
[15:34:02] [main/INFO]: Holder lookups applied
[15:34:02] [main/INFO]: Injecting itemstacks
[15:34:02] [main/INFO]: Itemstack injection complete
[15:34:02] [main/INFO]: Forge Mod Loader has successfully loaded 5 mods
[15:34:02] [main/WARN]: Skipping bad option: lastServer:
[15:34:02] [main/INFO]: Narrator library for x86 successfully loaded
[15:34:04] [Realms Notification Availability checker #1/INFO]: Could not authorize you against Realms server: Invalid session id
[15:34:09] [Server thread/INFO]: Starting integrated minecraft server version 1.12.2
[15:34:09] [Server thread/INFO]: Generating keypair
[15:34:09] [Server thread/INFO]: Injecting existing registry data into this server instance
[15:34:10] [Server thread/INFO]: Applying holder lookups
[15:34:10] [Server thread/INFO]: Holder lookups applied
[15:34:11] [Server thread/INFO]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@1d9d627)
[15:34:12] [Server thread/INFO]: Loaded 488 advancements
[15:34:12] [Server thread/INFO]: Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@1d9d627)
[15:34:12] [Server thread/INFO]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@1d9d627)
[15:34:12] [Server thread/INFO]: Preparing start region for level 0
[15:34:13] [Server thread/INFO]: Preparing spawn area: 1%
[15:34:14] [Server thread/INFO]: Preparing spawn area: 29%
[15:34:15] [Server thread/INFO]: Preparing spawn area: 58%
[15:34:16] [Server thread/INFO]: Preparing spawn area: 98%
[15:34:17] [Server thread/INFO]: Unloading dimension -1
[15:34:17] [Server thread/INFO]: Unloading dimension 1
[15:34:17] [Server thread/INFO]: Changing view distance to 8, from 10
[15:34:19] [Netty Local Client IO #0/INFO]: Server protocol version 2
[15:34:19] [Netty Server IO #1/INFO]: Client protocol version 2
[15:34:19] [Netty Server IO #1/INFO]: Client attempting to join with 5 mods : [email protected],[email protected],[email protected],[email protected],cb@BETA v1
[15:34:19] [Netty Local Client IO #0/INFO]: [Netty Local Client IO #0] Client side modded connection established
[15:34:19] [Server thread/INFO]: [Server thread] Server side modded connection established
[15:34:19] [Server thread/INFO]: Player349[local:E:ebcc711d] logged in with entity id 315 at (-247.83128399696773, 65.17664930947085, 233.1817762155986)
[15:34:19] [Server thread/INFO]: Player349 joined the game
[15:34:20] [Server thread/INFO]: Saving and pausing game...
[15:34:20] [Server thread/INFO]: Saving chunks for level 'New World'/overworld
[15:34:20] [pool-2-thread-1/WARN]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@1d0dda[id=e479674e-ef3e-3736-9f9e-94f79aafe9d7,name=Player349,properties={},legacy=false]
com.mojang.authlib.exceptions.AuthenticationException: The client has sent too many requests within a certain amount of time
    at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:79) ~[YggdrasilAuthenticationService.class:?]
    at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillGameProfile(YggdrasilMinecraftSessionService.java:180) [YggdrasilMinecraftSessionService.class:?]
    at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:60) [YggdrasilMinecraftSessionService$1.class:?]
    at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:57) [YggdrasilMinecraftSessionService$1.class:?]
    at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3716) [guava-21.0.jar:?]
    at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2424) [guava-21.0.jar:?]
    at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2298) [guava-21.0.jar:?]
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2211) [guava-21.0.jar:?]
    at com.google.common.cache.LocalCache.get(LocalCache.java:4154) [guava-21.0.jar:?]
    at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4158) [guava-21.0.jar:?]
    at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5147) [guava-21.0.jar:?]
    at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5153) [guava-21.0.jar:?]
    at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:170) [YggdrasilMinecraftSessionService.class:?]
    at net.minecraft.client.Minecraft.getProfileProperties(Minecraft.java:2997) [Minecraft.class:?]
    at net.minecraft.client.resources.SkinManager$3.run(SourceFile:110) [SkinManager$3.class:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_151]
    at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_151]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_151]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_151]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_151]
[15:34:23] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 3148ms behind, skipping 62 tick(s)
[15:34:27] [Server thread/INFO]: [Player349: Given [Spawn Creeper] * 1 to Player349]
[15:34:27] [main/INFO]: [CHAT] Given [Spawn Creeper] * 1 to Player349
[15:34:39] [Server thread/INFO]: [Player349: Given [Spawn] * 1 to Player349]
[15:34:39] [main/INFO]: [CHAT] Given [Spawn] * 1 to Player349
[15:34:53] [Server thread/INFO]: [Player349: Given [Spawn] * 1 to Player349]
[15:34:53] [main/INFO]: [CHAT] Given [Spawn] * 1 to Player349
[15:34:58] [Server thread/INFO]: [Player349: Given [Spawn] * 1 to Player349]
[15:34:58] [main/INFO]: [CHAT] Given [Spawn] * 1 to Player349
[15:35:04] [Server thread/INFO]: [Player349: Given [Spawn] * 1 to Player349]
[15:35:04] [main/INFO]: [CHAT] Given [Spawn] * 1 to Player349
[15:35:14] [main/INFO]: [CHAT] Data tag parsing failed: Expected '}' but got ')' at: {EntityTag:{id:"cyborg1")<--[HERE]
[15:35:21] [Server thread/INFO]: [Player349: Given [Spawn] * 1 to Player349]
[15:35:21] [main/INFO]: [CHAT] Given [Spawn] * 1 to Player349
[15:35:36] [Server thread/INFO]: [Player349: Given [Spawn] * 1 to Player349]
[15:35:36] [main/INFO]: [CHAT] Given [Spawn] * 1 to Player349
[15:35:44] [Server thread/INFO]: [Player349: Given [Spawn] * 1 to Player349]
[15:35:44] [main/INFO]: [CHAT] Given [Spawn] * 1 to Player349
[15:35:49] [Server thread/INFO]: [Player349: Given [Spawn] * 1 to Player349]
[15:35:49] [main/INFO]: [CHAT] Given [Spawn] * 1 to Player349
[15:36:08] [Server thread/INFO]: [Player349: Given [Spawn] * 1 to Player349]
[15:36:08] [main/INFO]: [CHAT] Given [Spawn] * 1 to Player349
[15:36:14] [Server thread/INFO]: [Player349: Given [Spawn] * 1 to Player349]
[15:36:14] [main/INFO]: [CHAT] Given [Spawn] * 1 to Player349
[15:36:14] [main/INFO]: Loaded 2 advancements
[15:36:25] [Server thread/INFO]: [Player349: Given [Spawn] * 1 to Player349]
[15:36:25] [main/INFO]: [CHAT] Given [Spawn] * 1 to Player349
[15:36:50] [Server thread/INFO]: Saving and pausing game...
[15:36:50] [Server thread/INFO]: Saving chunks for level 'New World'/overworld
[15:36:51] [Server thread/INFO]: Stopping server
[15:36:51] [Server thread/INFO]: Saving players
[15:36:51] [Server thread/INFO]: Player349 lost connection: Disconnected
[15:36:51] [Server thread/INFO]: Player349 left the game
[15:36:51] [Server thread/INFO]: Stopping singleplayer server as player logged out
[15:36:51] [Server thread/INFO]: Saving worlds
[15:36:51] [Server thread/INFO]: Saving chunks for level 'New World'/overworld
[15:36:51] [Server thread/INFO]: Unloading dimension 0
[15:36:52] [Server thread/INFO]: Applying holder lookups
[15:36:52] [Server thread/INFO]: Holder lookups applied
[15:36:54] [main/INFO]: Stopping!
[15:36:54] [main/INFO]: SoundSystem shutting down...
[15:36:54] [main/WARN]: Author: Paul Lamb, www.paulscode.com
Java HotSpot(TM) Client VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

EntityCyborg1.class:

Spoiler

package com.cb.cyborg.entity;

import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.world.World;

public class EntityCyborg1 extends EntityZombie
{

    public EntityCyborg1(World worldIn)
    {
        super(worldIn);
    }
    
}

 

My current problems are:

  • no spawnegg (even throu /give, so far)
  • default zombie model
  • default zombie-texture
Link to comment
Share on other sites

Perhaps this is also helpful.

RenderCyborg1:

Spoiler

package com.cb.cyborg.entity.render;

import com.cb.cyborg.entity.EntityCyborg1;
import com.cb.cyborg.entity.model.ModelCyborg1;
import com.cb.cyborg.util.Reference;

import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.util.ResourceLocation;

public class RenderCyborg1 extends RenderLiving<EntityCyborg1>
{
    public static final ResourceLocation TEXTURES = new ResourceLocation(Reference.MOD_ID + ":textures/entity/cyborg1.png");
    
    public RenderCyborg1(RenderManager manager)
    {
        super(manager, new ModelCyborg1(), 0.5F);
    }

    @Override
    protected ResourceLocation getEntityTexture(EntityCyborg1 entity)
    {
        return TEXTURES;
    }
    
    @Override
    protected void applyRotations(EntityCyborg1 entityLiving, float p_applyRotations_2_, float rotationYaw, float partialTicks)
    {
        super.applyRotations(entityLiving, p_applyRotations_2_, rotationYaw, partialTicks);
    }
}

 

RenderHandler:

Spoiler

package com.cb.cyborg.util.handlers;

import com.cb.cyborg.entity.EntityCyborg1;
import com.cb.cyborg.entity.render.RenderCyborg1;

import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraftforge.fml.client.registry.IRenderFactory;
import net.minecraftforge.fml.client.registry.RenderingRegistry;

public class RenderHandler
{
    public static void registerEntityRenders()
    {
        RenderingRegistry.registerEntityRenderingHandler(EntityCyborg1.class, new IRenderFactory<EntityCyborg1>()
        {
            @Override
            public Render<? super EntityCyborg1> createRenderFor(RenderManager manager)
            {
                return new RenderCyborg1(manager);
            }
        });
    }
}

 

RegistryHandler:

Spoiler

import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.EntityEntry;

@EventBusSubscriber
public class RegistryHandler
{
    @SubscribeEvent
    public static void onItemRegister(RegistryEvent.Register<Item> event)
    {
        event.getRegistry().registerAll(ItemInit.ITEMS.toArray(new Item[0]));
    }
    
    @SubscribeEvent
    public static void onBlockRegister(RegistryEvent.Register<Block> event)
    {
        event.getRegistry().registerAll(BlockInit.BLOCKS.toArray(new Block[0]));
    }
    
    @SubscribeEvent
    public static void onModelRegister(ModelRegistryEvent event)
    {
        for(Item item : ItemInit.ITEMS)
        {
            if(item instanceof IHasModel)
            {
                ((IHasModel)item).registerModels();
            }
        }
        
        for(Block block : BlockInit.BLOCKS)
        {
            if(block instanceof IHasModel)
            {
                ((IHasModel)block).registerModels();
            }
        }
    }
    
    
    public static void preInitRegistries()
    {
        RenderHandler.registerEntityRenders();
    }
    
    @SubscribeEvent
    public static void onEntitiesRegistry(RegistryEvent.Register<EntityEntry> event)
    {
        EntityInit.registerEntities(event);
    }
}

 

Link to comment
Share on other sites

27 minutes ago, Cadiboo said:

please post your logs & your EntityCyborg class

the actual entity class please

 

30 minutes ago, Cadiboo said:

 

I don't see where preInitRegistries() is being called.

You should probably try registering your entity renders like this.

https://github.com/Cadiboo/WIPTechAlpha/blob/fc508e4dd439603888ca2caf08c0b871372764d4/src/main/java/cadiboo/wiptech/EventSubscriber.java#L325-L332 

  • Thanks 1

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

1 hour ago, DeBugger said:

I will try it. What do you mean with "actual entity class"? I poste it. Later I will add an AI but at the moment the mob should perform actions like a zombie. I havnt delete anything.

The class that extends Entity____

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Here it is:

Spoiler

package com.cb.cyborg.entity;

import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.world.World;

public class EntityCyborg1 extends EntityZombie
{

    public EntityCyborg1(World worldIn)
    {
        super(worldIn);
    }
    
}

Or do you mean the EntityZombie-class? I have a DevWorkspace setup, so I cant reach the MC-sourcecode. Sorry.

Edited by DeBugger
Link to comment
Share on other sites

25 minutes ago, DeBugger said:

Or do you mean the EntityZombie-class?

No. You should never post vanilla code. What you posted is what was required.

25 minutes ago, DeBugger said:

I have a DevWorkspace setup, so I cant reach the MC-sourcecode.

Yes you can. Its under Referenced Libraries.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

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



×
×
  • Create New...

Important Information

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