I am having difficulty in receiving PlayerInteractEvent from a vanilla server. The event simply never fires for LEFT_CLICK_BLOCK. Is PlayerInteractEvent a server-side only event?
Did you register the class that contains the event? See this page for detailed instructions. Also make sure you register it to the correct bus or it won't fire at all.
Rollback Post to RevisionRollBack
Click this banner for a list of illegal mod distributors -- only download from legal sites!
If you look at usages of PlayerInteractEvent.Action.LEFT_CLICK_BLOCK, you'll see that the event is only fired with this action from ItemInWorldManager#onBlockClicked (a server-side class). The client only fires the event with the RIGHT_CLICK_BLOCK and RIGHT_CLICK_AIR actions.
You may be able to suggest firing the event on the client in the Minecraft Forge forums or make a pull request yourself.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I am having difficulty in receiving PlayerInteractEvent from a vanilla server. The event simply never fires for LEFT_CLICK_BLOCK. Is PlayerInteractEvent a server-side only event?
Did you register the class that contains the event? See this page for detailed instructions. Also make sure you register it to the correct bus or it won't fire at all.
If you look at usages of PlayerInteractEvent.Action.LEFT_CLICK_BLOCK, you'll see that the event is only fired with this action from ItemInWorldManager#onBlockClicked (a server-side class). The client only fires the event with the RIGHT_CLICK_BLOCK and RIGHT_CLICK_AIR actions.
You may be able to suggest firing the event on the client in the Minecraft Forge forums or make a pull request yourself.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
sky_01, it is registered. It fires on RIGHT_CLICK_BLOCK as Choonster illustrated. Thanks though.
Choonster, I see what you mean. Thanks for that. I would think this would be very useful. I'll look at the source and see what can be done. Thanks.