Player Chat "e.setCancelled(true);" doesn't work

Discussion in 'Spigot Plugin Development' started by Snowmite, Jun 15, 2016.

  1. Yes.
  2. MiniDigger


    does the player get the message that he is not allowed to chat? if you does not get the message, your problem lies most likely in your mute command
  3. Yes, he does get the message that he cannot chat.
  4. MiniDigger


    so some other plugin is playing around with that event, try running only your plugin.
  5. kk
  6. Still let's the player chat...
  7. Maybe set the event priority if that's the issue

    Edit: If you're using 1.10 spigot, try updating to the newest build if you haven't already
  8. Change
    Code (Text):
    File file = new File (StaffUtils.getInstance ().getDataFolder () + File.separator + "users", File.separator + pl.getUniqueId ().toString () + ".yml");
    Code (Text):
    File file = new File (StaffUtils.getInstance ().getDataFolder () + File.separator + "users", pl.getUniqueId ().toString () + ".yml");
    The constructor of File that you're using takes the parent folder and then the child file you're making. You don't need the File.separator there.
    • Like Like x 1
  9. Just a note, loading the configuration every single message that the player sends is a little excessive..

    Load the config into a Map<UUID, FileConfiguration> on join, save and unload on quit.