Minecraft – How to make this contraption multiplayer

minecraft-commandsminecraft-java-edition

I made a grappling hook in Minecraft and put it into a structure. However, I want to use it in a multiplayer map where multiple people may be using it at one time. I believe the way it is currently only works with one player at a time. Can anyone assist me in making it multiplayer friendly? I have already checked with @e[name=unknown] and there isn't anything in the tags that shows who threw it. Here is the link to the structure file: http://www.mediafire.com/download/mieyjdc6uagsa9a/grapplehook.nbt
Just put "grapplehook" in a load structure block to load it. If you don't mind, don't reupload or use this structure or contraption in a map or a .nbt file without my permission, thanks. If you figure out how to make it multiplayer-friendly, please respond to a link with the new structure file or just tell me how to do it.

I'll try to briefly explain how it works.

  1. The player casts the fishing rod. The bobber entity can only be detected with [name=unknown].
  2. Once every tick an armor stand is summoned with the grapple tag and is given the same score as Next on gHook. Then 1 is added to Next on gHook.
  3. This repeats until the bobber hits the ground.
  4. Once it touches, it is killed and all the ArmorStands are given the grapple2 tag and Next is set to 1.
  5. The player is teleported to the first ArmorStand (with a gHook score of 1) and that armor stand is killed.
  6. All ArmorStands with the grapple2 tag have 1 subtracted from their score, making the second ArmorStand the first, the 3rd the 2nd, the 4th the 3rd, etc.
  7. Repeats step 5 and 6 until all there are no more ArmorStands with the grapple2 tag.

Notes:

-If the player does not have the grappling hook in their hand, all ArmorStands with the grapple tag are killed.

-The player's rotation is divided into 56 points in the sky and the ArmorStands are teleported based on the player's rotation of those 56 points.

Thanks and let me know soon!

Best Answer

If you are using a server hosting service (such as MC Pro Hosting, Cubed Host, etc.) then there should be an option in server settings or something similar to enable command blocks, make sure they're enabled.