thepurplepoe Posted July 1, 2013 Share Posted July 1, 2013 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. Quote Link to comment Share on other sites More sharing options...
ObsequiousNewt Posted July 1, 2013 Share Posted July 1, 2013 Where are you getting those player and world objects? And are you using Minecraft.theMinecraft? Quote BEWARE OF GOD --- Co-author of Pentachoron Labs' SBFP Tech. Link to comment Share on other sites More sharing options...
thepurplepoe Posted July 1, 2013 Author Share Posted July 1, 2013 I'm getting them from item.onupdate, then checking if its an instance of and casting the entity to entityplayer. Quote Link to comment Share on other sites More sharing options...
LutzBlox Posted July 1, 2013 Share Posted July 1, 2013 First, are you registering the entities with EntityRegistry? Then, what method are you spawning the bullet within the item class? Quote Link to comment Share on other sites More sharing options...
thepurplepoe Posted July 1, 2013 Author Share Posted July 1, 2013 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 Quote Link to comment Share on other sites More sharing options...
thepurplepoe Posted July 1, 2013 Author Share Posted July 1, 2013 Could someone please explain how to use the Entityregistry? Quote Link to comment Share on other sites More sharing options...
gff1979 Posted July 1, 2013 Share Posted July 1, 2013 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 Quote Link to comment Share on other sites More sharing options...
thepurplepoe Posted July 2, 2013 Author Share Posted July 2, 2013 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? Quote Link to comment Share on other sites More sharing options...
LutzBlox Posted July 2, 2013 Share Posted July 2, 2013 Can you post your entity and item classes? Quote Link to comment Share on other sites More sharing options...
LutzBlox Posted July 2, 2013 Share Posted July 2, 2013 And also, FYI, there is a working gun and bullet tutorial on the tutorials page. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.