Posted January 6, 20214 yr I'm creating a weapon that when left clicked it'll fire a projectile and play a noise. I got the noise to work, but the projectile won't fire no matter what I do or alter. Any help would be much appreciated Here's the code: https://pastebin.com/EGQ85QqZ
January 6, 20214 yr Author 45 minutes ago, diesieben07 said: As the LeftClickEmpty event clearly states it is client-side only. Entities need to be spawned on the server. That was easier than what I imagined lol, thank you!
January 6, 20214 yr Author 2 hours ago, diesieben07 said: As the LeftClickEmpty event clearly states it is client-side only. Entities need to be spawned on the server. Wait, never mind. I've tried putting an if statement over the method spawning the entity saying only if the world isn't remote, but it didn't do anything
January 7, 20214 yr Author 4 hours ago, diesieben07 said: Correct, the event is still client-only (as I pointed out and as is stated in its documentation). If you now check if you are on the server you are no longer incorrectly trying to spawn entities on the client, but your code still does not run on the server. I see what you mean. How would I go about that exactly? The OnlyIn annotation above the subscribe event? That's all I can really think of when making the server aware of the event
January 7, 20214 yr Annotations does not do that. https://mcforge.readthedocs.io/en/latest/concepts/sides/#fmlenvironmentdist-and-onlyin What you are looking for is packets.
January 7, 20214 yr Author 2 hours ago, poopoodice said: What you are looking for is packets. Got it to work! Thank you!
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.