Show overlay when existing block right-clicked

Started by IndyCallisto on Fri, 01/14/2022 - 22:10

Topic category: Help with modding (Java Edition)

Last seen on 02:05, 19. Feb 2022
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Show overlay when existing block right-clicked
Fri, 01/14/2022 - 22:10

I'm trying to make a mod about the moon. When the player right-clicks on a bed in my custom Moon dimension, an overlay temporarily appears for three seconds saying "Time doesn't seem to pass normally here...". However, I can't figure out how to make the overlay show when the block is right-clicked. Also, I want it to work for all colors of beds.

Please provide screenshots? I get confused easily by a wall of text, lol.

Last seen on 17:05, 20. May 2022
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Hi, before you read, keep in…
Sat, 01/15/2022 - 15:41

Hi, before you read, keep in mind, I'm Russian. and this text is translated by a translator.

I will not provide you with screenshots, but I know how you can realize your idea.

step 1: create a variable
step 2: create a procedure that, when clicking on the bed, sets the value of the variable, for example 30
step 3: create a player tick procedure, every 20 ticks the value of the variable is decremented by 1
step 4: create an overlay
step 5: create a procedure that returns TRUE if the variable is greater than 0 and ELSE if the variable is equal to 0
step 6: in the overlay display conditions, select this procedure

in theory this should work correctly, the rest depends on the syntax and the correct construction of the algorithm.
Happy to help, good luck