-
New Feature
-
Resolution: Unresolved
-
Minor
-
None
-
None
-
- This server is running CraftBukkit version git-Spigot-17d78db-f8d4da0 (MC: 1.16.3) (Implementing API version 1.16.3-R0.1-SNAPSHOT)
- You are running the latest version
-
CraftBukkit version git-Spigot-17d78db-f8d4da0
-
Yes
// Cancelling the event will remove the vanilla message but the action bar message won't work, it will only work if you delay it. @EventHandler(priority = EventPriority.HIGHEST) public void onBedEnter(PlayerBedEnterEvent e) { e.setCancelled(true); e.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("This message doesn't work.")); }
// Working example @EventHandler(priority = EventPriority.HIGHEST) public void onBedEnter(PlayerBedEnterEvent e) { e.setCancelled(true); Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { @Override public void run() { e.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("This message works.")); } }, 1L); }