Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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?

  • 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

  • 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

Maybe something like this?

EntityYourName var14 = new EntityYourName(par1World, x, y, z)
par1World.spawnEntityInWorld(var14);

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

  • 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?

  • 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

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.

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

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.