我使用 下方程式得到了当前整点时间,
Date today=new Date();
SimpleDateFormat f=new SimpleDateFormat("HH");
String time=f.format(today);
使用 PlayerJoinEvent去监听
然后 time.equalsIgnoreCase("12")比较
通过测试发现time=12但是并没有将我提出服务器
请问怎么写呢
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)
可以试试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)
哈哈哈呵呵呵
事件告诉你发生了, 但是实际操作还没有执行, 玩家还没有进入到服务器
可以在下一个tick执行
复制代码
可以在下一个tick执行
 
- new BukkitRunnable(() - > {
 
- //code
 
- }
 
- ).runTask(Plugin plugin);
请把你的代码全部发出来,我们才好看是哪里出了问题