How to spawn entities in correct coordinates for servers (Multiplayer Compatibility Issue)

Started by CBJaxxx on

Topic category: Help with Minecraft modding (Java Edition)

Joined Mar 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to spawn entities in correct coordinates for servers (Multiplayer Compatibility Issue)
Wed, 03/29/2023 - 19:49 (edited)

I made a missile mod where you can place down a missile right click it to open up a gui and enter coordinate's and launch with a button.

After a the missile is launched it spawns a entity at the x, y+1500 and z coordinates the coordinates are setup to their own text inputs in the launch gui, so when the player enters a number in the first textfield it enters a number for the x location to spawn the missile_impact entity and the same thing for the y and z coordinates.

My missile_launched entity works and spawns in right after the missile block is removed so it can fly into the sky, then shortly after the missile_impact entity will finally hit the ground triggering an explosion.

I am making this mod multiplayer compatible, however when I use this mod on servers the missile entity spawns in at the servers spawn every time instead of the x y z coordinates I set in the launch gui, this only happens when I use this mod on a server but if I use it in singleplayer or lan games it works perfectly.

How can I get my missile entity to spawn at the x y and z coordinates that I set even when I use the mod on a server?

Launch Procedure Pic Below

Astra_Warfare [C:\Users\codeb\MCreatorWorkspaces\astro_warfare] - Launch (Procedure) - MCreator 2023.1 (gyazo.com)

Launch GUI Pic Below

Astra_Warfare [C:\Users\codeb\MCreatorWorkspaces\astro_warfare] - LaunchGUI (GUI) - MCreator 2023.1 (gyazo.com) 

Edited by CBJaxxx on Wed, 03/29/2023 - 19:49