type CommandHandler = fn(&mut Server, Entity, Entity, Vec<String>, &ServerChatCommand) -> Result<(), Content>;Expand description
Handler function called when the command is executed.
§Arguments
&mut Server- theServerinstance executing the command.EcsEntity- anEntitycorresponding to the player that invoked the command.EcsEntity- anEntityfor the player on whom the command is invoked. This differs from the previous argument when using /sudoVec<String>- aVec<String>containing the arguments of the command after the keyword.&ChatCommand- the command to execute with the above arguments – Handler functions must parse arguments from the the givenString(parse_args!exists for this purpose).
§Returns
A Result that is Ok if the command went smoothly, and Err if it
failed; on failure, the string is sent to the client who initiated the
command.