Posted July 1, 201312 yr 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.
July 1, 201312 yr Where are you getting those player and world objects? And are you using Minecraft.theMinecraft? BEWARE OF GOD --- Co-author of Pentachoron Labs' SBFP Tech.
July 1, 201312 yr Author I'm getting them from item.onupdate, then checking if its an instance of and casting the entity to entityplayer.
July 1, 201312 yr First, are you registering the entities with EntityRegistry? Then, what method are you spawning the bullet within the item class?
July 1, 201312 yr Author Sorry for this but. Whats the Entity registry? And I'm spawning it in a helper method called from onupdate after checking fire rates and stuff
July 1, 201312 yr The basic tutorials cover the different Registries. They are basically how the game organizes resources... but seriously do the beginner tutorials and all will become clear. http://www.minecraftforge.net/wiki/Tutorials
July 2, 201312 yr 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.