Boss trigger GUI element

Started by STAINFUL_STEEL on

Topic category: Help with modding (Java Edition)

Last seen on 02:44, 18. Sep 2022
Joined Sep 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Boss trigger GUI element

I need to make a boss that when first spawned triggers a custom GUI element. and when the boss dies, the GUI element goes away

Is there any way I could do this with procedures?

Last seen on 17:34, 2. Oct 2023
Joined Dec 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The only way I can think of…
Sun, 09/11/2022 - 16:10

The only way I can think of doing this is using an on-player tick global trigger to check if your boss mob is within a certain distance from the player. You would need to make use of the Entity Iterator to check for an entity in a certain range.

 

Step 1: Make a stand-alone procedure with the global trigger on-player tick. This will be used to check if your boss mob is nearby. 

 

Step 2: Add an If-Do statement then under world data, at the very bottom of the list choose the Does entity exist at x: [x] y: [y] z: [z] in square cube with size [4] of type [No entry].

 

Step 3: Leave the coordinates alone as it is checking from the players current location. Change the number 4 to double the distance in blocks you want to check for. (Remember, this procedure is checking a full diameter around the player, setting the number to 64 would only check up to 32 blocks away from the player) then set the entity to your boss mob.

 

Step 4: After the do statement, do a simple return true then attached to the bottom of your procedure, make a simple return false

 

Step 5a: Exit your GUI/Overlay. You could attempt to attach the on-player tick procedure to your GUI/Overlay display condition, however it may not work as desired. Other words, continue through steps 5b-7.

Step 5b: If 5a does not work successfully. Edit your GUI and create a new procedure for Display GUI/overlay in-game

 

Step 6: Using an If-Do statement. Under the advanced tab, scroll down and select the logical "Call procedure and get return value [select the newly created on-player tick procedure]" and check if this statement is true using the logical []=[] under the logic tab.

 

Step 7: When you are finished with the procedures, they should look something like the below.

 

On-Player tick
If
 Does entity exist at x: [x] y: [y] z: [z] in square cube size [64] of type [Boss Entity]
do    return true

return false

 

GUI/Overlay display condition
If 
call procedure and get return value [playertickupdate] true

do    return true
return false