Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

First, are you registering the entities with EntityRegistry?  Then, what method are you spawning the bullet within the item class?

  • Author

Sorry for this but. Whats the Entity registry?  :P

And I'm spawning it in a helper method called from onupdate after checking fire rates and stuff

  • Author

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?

 

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.