Topic category: Help with modding (Java Edition)
I have a huge problem: i want to run a procedure when the player left clicks, but there is no keybinding for that. I want also that the procedure is runnable only if the player has no item in main hand. I'm desperate because to detect the left click i have to use global triggers like "player uses item" or "player left click on block" or "entity attaked" (setting the sourceentity logic nbt tag "leftclicked" to true), BUT i don't want items in hand and i don't want to hit an entity to trigger the procedure ("player left click on block" trigger is useless to me).
Other details to what i want to do: i want that when a player has a custom effect, has no items in main hand, and left clicks, even if has clicked in air, it run a procedure that shoots a fireball, whatever the player has clicked.
I searched everywhere but i didn't found the answer. I hope someone can answer.
Sorry for the bad english.