Entity.class
is the class type you want to register, the argument
is the argument the player just typed, you can use it to check if it is what you want it to be.
We then return a TypeResult
bject, which has two constructors, one that will accept an object in our case the entity and the other is the argument, the second is just for the argument, meaning the first object is null. This is useful for later to handle errors as if the entity is null it doesn't exist. It allows you to both handle your errors in the command class and also to get the raw value of the command typed, making it possible for you to have case specific error messages in your command class.
By registering a new parameter with the same Class
as an existing one, you can override it.