Started by
adamdived
on
Topic category: Help with Minecraft modding (Java Edition)
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 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)
Thank you for the response. I did what you said and it works perfectly.