JorelAli/CommandAPI

TimeArgument gives unexpected error

Mullp opened this issue · 1 comments

Mullp commented

CommandAPI version

8.5.0

Minecraft version

1.19

Are you shading the CommandAPI?

Yes

What I did

  • I registered this code in my onLoad() function:
new CommandAPICommand("timeargument")
        .withArguments(new TimeArgument("duration"))
        .executes((commandSender, objects) -> {
          commandSender.sendMessage("Duration: " + (int) objects[0]);
        })
        .register();
  • I ran "/timeargument 1d"

What actually happened

I get the error An unexpected error occurred trying to execute that command (Argument 'duration' is defined as , not class java.lang.Integer)
image

What should have happened

I would have gotten the message: "Duration: 24000"

Server logs and CommandAPI config

No response

Other

No response

Fixed in 8.5.1.