laifsjo Posted February 13, 2013 Posted February 13, 2013 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? Quote
laifsjo Posted February 13, 2013 Author Posted February 13, 2013 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 Quote
laifsjo Posted February 13, 2013 Author Posted February 13, 2013 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 Quote
SeKtOR Posted February 13, 2013 Posted February 13, 2013 Maybe something like this? EntityYourName var14 = new EntityYourName(par1World, x, y, z) par1World.spawnEntityInWorld(var14); Quote
Mazetar Posted February 13, 2013 Posted February 13, 2013 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. Quote Quote If you guys dont get it.. then well ya.. try harder...
laifsjo Posted February 14, 2013 Author Posted February 14, 2013 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? Quote
laifsjo Posted February 17, 2013 Author Posted February 17, 2013 comon guys, can nobody help me out with this? please? Quote
laifsjo Posted February 19, 2013 Author Posted February 19, 2013 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 Quote
shucke Posted February 19, 2013 Posted February 19, 2013 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. Quote http://www.minecraftforum.net/topic/1937703-162smpforge-pet-mastery-hatch-level-battle/
laifsjo Posted February 20, 2013 Author Posted February 20, 2013 i'll do that, thanks for anwsering guys! Quote
laifsjo Posted February 21, 2013 Author Posted February 21, 2013 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. Quote
laifsjo Posted February 23, 2013 Author Posted February 23, 2013 Thank you, that helped. Problem solved, thank you guys for helping me Quote
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.