凉凉丶
我使用 下方程式得到了当前整点时间,
    Date today=new Date();
    SimpleDateFormat f=new SimpleDateFormat("HH");
    String time=f.format(today);
使用 PlayerJoinEvent去监听
然后 time.equalsIgnoreCase("12")比较
通过测试发现time=12但是并没有将我提出服务器
请问怎么写呢

天辉胡萝卜
PlayerJoinEvent不能被取消
可以试试PlayerLoginEvent的disallow?(@NotNull PlayerLoginEvent.Result result, @NotNull String message)

https://hub.spigotmc.org/javadoc ... Event.html#disallow(org.bukkit.event.player.PlayerLoginEvent.Result,%20java.lang.String)

fengrenhan
哈哈哈呵呵呵

July_Summer
事件告诉你发生了, 但是实际操作还没有执行, 玩家还没有进入到服务器
可以在下一个tick执行

  1. new BukkitRunnable(() - > {
  2. //code
  3. }
  4. ).runTask(Plugin plugin);
复制代码

轻光233
请把你的代码全部发出来,我们才好看是哪里出了问题