Ight, I have a script setup that detects player right clicking my custom blocks, anyone got ideas how can I connect that to running commands? I can probably setup a function I think I know enough about it now, and I'm actively reading up on scripting stuff. But as of now I can't figure out how to run a command when this is triggered.
world,
system
} from "@minecraft/server";
world.beforeEvents.playerInteractWithBlock.subscribe((event) => {
if (event.block.typeId === "qol:lesser_ender_core") {
world.sendMessage("You clicked");
}
});``` here's the code I have running right now as an example