Thanks to visit codestin.com
Credit goes to github.com

Skip to content

TimeArgument gives unexpected error #314

@Mullp

Description

@Mullp

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingimplemented for next releaseThis has been implemented in the current dev build for the next public release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions