Any Block Removed Counter

Started by adamdived on

Topic category: Help with modding (Java Edition)

Last seen on 17:41, 12. May 2023
Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Any Block Removed Counter

Hello everyone. I mainly code in C# and Java but i'm new in MCreator. So i hope i can get help. For a personal project i'm making with an external AI controlling the main player, i need to show in the game screen a counter that count each single block destroyed by the player. What would the best way to do it? I just need a simple counter that add 1 integer every time a block is destroyed. I created the UI with all the labels. Should i create a "custom element" and code the functions directly in there? Is there any specific API reference should i import in the script for this? Thanks in advance for any help i can receive.

Global variable (with a…
Tue, 05/09/2023 - 22:18

Global variable (with a player scope), then add a peocddire with a global trigger "on block destroyed", check if it's broken by a player and if so, increment by one your global variable. Then, return your global variable on your overlay or GUI (using a label)

Last seen on 17:41, 12. May 2023
Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you for the response…
Wed, 05/10/2023 - 11:36

Thank you for the response. I did what you said and it works perfectly.