Jump to content

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


laifsjo

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.