Jump to content

1.10.2 - Custom Mobs dont work Server-side, but Singleplayer work fine!


Recommended Posts

Posted

1.10.2 - Custom Mobs dont work Server-side, but Singleplayer work fine!

 

Sry for my english.

 

Own mob do not go Server-sided, but in the single player it goes well. The Spawn eggs spawnen the monster in server worlds not. As said Client-sided it goes. At which place lies my mistake. I know that this is no Forge mistake, but my Mod mistake ;) Thanks to you already in prerau

 

german:

Eigene Mobs gehen Server-seitig nicht, aber im Einzelspieler geht es gut. Die Spawn-Eier spawnen das Monster auf Server-Welten nicht. Wie gesagt Client-seitig geht es. An welcher Stelle liegt mein Fehler. Ich weiß, dass dies kein Forge-Fehler ist, sondern mein Mod-Fehler ;) Danke euch schon mal im Vorraus

Posted

Main Class sinobinmain:

 

@SidedProxy(clientSide="sinobinmod.proxy.ClientProxy", serverSide="sinobinmod.proxy.ServerProxy")

 

//================================================================================

 

ClientProxy:

 

public class ClientProxy extends ServerProxy {

 

public void registerRenderThings(){

 

  EntityCreator.createEntity(sinobinmain.mob_beaver, EntityBeaver.class, new RenderBeaver(), "beaver", EnumCreatureType.CREATURE, 10, 2, 3, new Biome[] {

  Biomes.RIVER}, 0x664106, 0x120E08, true);

  }

}

 

//======================================================================================

 

public class EntityCreator {

 

public static final void createEntity(int id, Class entityClass, Render render, String entityName, EnumCreatureType type, int probability, int minSpawn, int maxSpawn, Biome[] biomes,

  int solidColor, int spotColor, boolean hasSpawnEgg){

 

EntityRegistry.registerModEntity(entityClass, entityName, id, sinobinmain.instance, 64, 1, true);

EntityRegistry.addSpawn(entityClass, probability, minSpawn, maxSpawn, type, biomes);

RenderingRegistry.registerEntityRenderingHandler(entityClass, render);

 

if(hasSpawnEgg){

EntityRegistry.registerEgg(entityClass, solidColor, spotColor);

}

}

 

Posted

Good jorb, the server has no idea you even added an entity at all: your entity registration is client-side-only because it is inside your client-proxy.

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.

Posted

Exactly this I imagined of beginning also, but all the same how I push between ClientProxy and ServerProxy there un here, the Spawn Egg also not even exists afterwards and the Entity not :(

 

german:

Genau das dachte ich mir Anfangs auch, aber egal, wie ich zwischen ClientProxy und ServerProxy hin und her schiebe, das Spawn Egg existiert danach nicht  einmal und das Entity auch nicht :(

 

========================================================

ClientProxy:

 

public class ClientProxy extends ServerProxy{

 

  public void registerRenderThings(){

    RenderingRegistry.registerEntityRenderingHandler(EntityBeaver.class, new RenderBeaver());

  }

 

}

 

ServerProxy:

 

public class ServerProxy{

 

  public void registerThings(){

    EntityRegistry.registerModEntity(EntityBeaver.class, "beaver", sinobinmain.mob_beaver, sinobinmain.instance, 64, 1, true);

    EntityRegistry.registerEgg(EntityBeaver.class, 0x664106, 0x120E08);

    EntityRegistry.addSpawn(EntityBeaver.class, 10, 2, 3, EnumCreatureType.CREATURE, new Biome[] {Biomes.RIVER});

  }

 

}

Posted

NO! Jesus... READ THE LINK I GAVE YOU!

http://mcforge.readthedocs.io/en/latest/concepts/sides/

 

Client = Client.jar

Server = Dedicated.jar

 

You ServerProxy is supposed to be fired for Dedicated.jar and ClientProxy for Client.jar.

 

Entity should be registered in pre-init on BOTH SIDES - thus either main mod pre-init OR CommonProxy method called from pre-init.

Render should be registered on CLIENT, so in ClientProxy.

 

CommonProxy is abstract base! // handler registering code for both sides

ClientProxy extends CommonProxy // handles registering rendering stufff for only client

ServerProxy extends CommonProxy // almost never used, but sometimes required to do stuff for dedicated server (e.g database connection)

@SidedProxy(client = clientProxy, server = serverProxy)

1.7.10 is no longer supported by forge, you are on your own.

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.