Structure Locator utility item - I need help w/ procedures

Started by Vandium_23 on

Topic category: Help with modding (Java Edition)

Last seen on 21:15, 7. Apr 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Structure Locator utility item - I need help w/ procedures

I'm starting work on a special adventure mod for a friend of mine, and I need help with procedures. I'm trying to make an item called the structure locator, but I'm not sure how to set it up using procedures. I have the art for the item and the gui set up already, but nothing is currently working, except that right-clicking on the item opens the gui. The gui is currently very simple, 1 slot and a button. Let me explain how I would like it to work.

The locator exchanges 1 item (currently called a key item) for a direction for a structure. Example: eye of ender as the key item, and the locator would point towards the stronghold until the player reaches the stronghold. I understand the logic that needs to go into the procedures, but I'm having a hard time figuring out which blocks to use. 

The logic for this I would think is very simple:

  1. Check if the item in the slot matches an item from a premade list.
  2. Once the button is pressed, it removes the item from the slot, then it runs the locate command to find the corresponding structure. 
  3. It would then take the coordinates from the command, and would constantly check if the player is facing them, if so then the item updates (either beeps or changes texture).
  4. Once the player reaches the structure, the structure locator resets (or if possible, remembers those coordinates, and voids them during next usage).

My biggest problem is not knowing which blocks to use for the procedure. If I had a template I would be fine. Any and all help would be appreciated. 

Last seen on 21:15, 7. Apr 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
After spending 7ish hours…
Wed, 02/28/2024 - 02:19

After spending 7ish hours researching this, I have concluded that steps 2 and 3 are impossible (at least for now). I got steps 1 and part of 4 done, but I am unable to pull coordinates from the /locate command. Overall this won't affect my project too much, it just mean I can't use random world generation (I've got a ton of building to do).