tModLoader
                                
                                
                                
                                    tModLoader copied to clipboard
                            
                            
                            
                        Better Description for ModItem.UseItem
Description
Currently, the document description for ModItem.UseItem says "Runs on all clients and server". This is true for the most part. However, right-click actions will only be ran on the local client. This is vanilla quirk due to the game not syncing Player.controlUseTile in the control sync code. This in turn will affect the check in the Player.ItemCheck_ManageRightClickFeatures and the controlUseItem never gets set to true. There is a check for Player.controlUseItem in the before the code that manages Player.itemAnimation. As there is a itemAnimation > 0 check right before the ItemLoader.UseItem hook, this will never be called on remote clients. You can see this in action just by using right-click target feature for summon/sentry staves. Remote clients won't even see the player swing the staff. So my proposal is : Change the description on the document to indicate that right-click actions only gets called on local client.
What does this proposal attempt to solve or improve?
It could be very frustrating for modders when a hook doesn't act the way it is described. This would eliminate the confusion.
Which (other) solutions should be considered?
Remove the vanilla quirk by syncing the Player.controlUseTile field. But this has some complications as it changes vanilla behavior.