Jump to content

Help!, Entities in Multiplayer


thepurplepoe

Recommended Posts

Help! I'm extremely confused.

 

I've made a mod in which there are a large variety of Projectile weapons and Energy weapons, the Entities fired are EntityBullet, EntityLaser and so on, the code used to spawn them (in the gun class is):

 

EntityBullet b = new EntityBullet(world, entityplayer, 10, 0, 4);

world.spawnEntityInWorld(b);

 

And I have a RenderRegistry register for the entities (so they render).

 

On singleplayer they work perfectly, they shoot, they hit things, destroy blocks, kill stuff and render.

 

However on a LAN server only the hosts bullets have any effect, a person who connects to the LAN, can shoot but his bullets have no effect at all on entities, and appear to have and effect on blocks but actually dont.

 

I think this is because the entities are only being spawned on the client not the server, but maybe wrong.

 

 

How can I make this work?, I'm a total Multiplayer coding noob.

Link to comment
Share on other sites

Tried registering it in my mod load.

 

EntityRegistry.registerModEntity(EntityBullet.class, "Bullet", 120, this, 250, 1, true);

 

And the same result (as before), except now it crashes sometimes.

 

Is there any packet stuff or anything else I should be doing?

 

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.