Jump to content

[SOLVED] How do i spawn an enitity on client side?


Recommended Posts

Posted

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?

Posted

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

Posted

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

Posted

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?

Posted

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

Posted

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.

Posted

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.

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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