Posted February 13, 201312 yr Hello, i got a problem with my mod, i am trying to spawn an entity (like an arrow) by hitting a key. I understand this is client sided, but how can i spawn that entity and get it functioning like it's on the server, because how i'm doing it now, it will spawn the entity, but it cant damage mobs. Can someone help me out?
February 13, 201312 yr Author i tried that, but how do i send that packet, and what do i type to send the packet? i didnt find any tutorials for it
February 13, 201312 yr Author i already read that tutorial, but what i understood of that was that i can check if i'm client or server side. i'm trying to do this in SSP, but i really have no idea how to do it
February 13, 201312 yr Maybe something like this? EntityYourName var14 = new EntityYourName(par1World, x, y, z) par1World.spawnEntityInWorld(var14);
February 13, 201312 yr When you are inn SSP you are just playing on a locally hosted server, therefore no matter if it's SSP or not you need to send packets to update the client and the server on relevant changes. If you guys dont get it.. then well ya.. try harder...
February 14, 201312 yr Author okay, everybody tells me i have to send packets, i already read the tutorial of packets, but i still don't know how to send a packet from client to the server to spawn an entity, could somebody just tell that?
February 19, 201312 yr Author thanks for responding, but i read that tutorial, and all i came up with was checking if i'm server side or client side. i was client side, so i have no idea how i would do it
February 19, 201312 yr A packet is used sending informartion from the client to the server or visa versa. so what you need to is send a packet from the client to the server. the tutorial describes how to do that. i dont think its very helpfull to code it for you since you dont understand packets yet. so my advice is to just read to tutorial over and over again and try to experiment some with the code so you can see what it does. if you have any questions about the turorial ask them here instead of saying i dont understand. try to explain what you dont get about it. http://www.minecraftforum.net/topic/1937703-162smpforge-pet-mastery-hatch-level-battle/
February 21, 201312 yr Author okay, i did everything the tutorial did, but now i just dont know one thing, how would i spawn the entity, the only thing that i do, is send the packet to the server through that queu or something, but how do i spawn the entity then? EDIT: i can't spawn the entity because i don't have a world instance. I checked, and i AM on the server side, but when i get an instance of World by typing this: ModLoader.getMinecraftInstance().theWorld; that world instance is still client sided.
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.