Hi there,
I'm encountering an issue with the BlockEvents.rightClicked event. I’ve set up a system where a custom block (a "Server Rack") should allow players to interact with it by right-clicking with specific items (currently diamond block for CPU, gold block for RAM, I'll make proper items later). The expected behavior is as follows:
- When the player right-clicks the block while holding a specific item (diamond block or gold block):
- The item should be removed from their inventory.
- The menu slot in the GUI should update to reflect the inserted item (e.g., update the button to show the CPU/RAM).
- If the player is not holding a valid item, the menu should simply open as normal.
The problem occurs when the player right-clicks with a block (e.g., diamond block or gold block). Instead of the item being removed from the inventory and updating the menu, the block is placed in front of the Server Rack as if it were a normal block placement. This behavior prevents the interaction logic from running properly.