MiraiForum

    • Register
    • Login
    • Search
    • Popular
    • Recent
    • Unsolved
    • Tags
    • Groups
    • 友情链接

    Solved java版command相关问题

    开发交流
    10
    24
    2631
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      hundun000 ⭐2021⭐ @Orisland last edited by hundun000

      @orisland 在 新手求助java版的command到底怎么用啊…… 中说:
      你这样写的意思就是要求两个参数啊。是来自console文档样例吧,那里也注释了// 这两个参数会被作为指令参数要求

      @Handler
      public void onCommand(CommandSender sender, User target, String mes){
          target.sendMessage(mes);
      }
      

      这才是不需要参数(参考QuizCommand类exit方法):

      @Handler
      public void onCommand(CommandSender sender){
          sender.sendMessage("hello world");
      }
      
      Orisland 1 Reply Last reply Reply Quote 0
      • Orisland
        Orisland 摸鱼 @hundun000 last edited by

        我这就去自裁。

        1 Reply Last reply Reply Quote 0
        • Orisland
          Orisland 摸鱼 @hundun000 last edited by

          @hundun000 估计原因相似
          没有在本地安装chat-command..

          1 Reply Last reply Reply Quote 0
          • wssy001
            wssy001 ⭐2021⭐ last edited by

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • Referenced by  Orisland Orisland 
            • 1
            • 2
            • 2 / 2
            • First post
              Last post
            Powered by Mamoe Technologies & NodeBB | 友情链接 | 服务监控 | Contact