Cancels the event of the interacted block

This commit is contained in:
SvenjaReißaus 2019-03-18 21:42:42 -05:00
parent ff9b125426
commit 35b5724da5
No known key found for this signature in database
GPG Key ID: E5494A03FA36D54B
2 changed files with 2 additions and 0 deletions

View File

@ -30,6 +30,7 @@ import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
@ -890,6 +891,7 @@ public class FactionsPlayerListener implements Listener {
SavageFactions.plugin.log("Guess we will cancel the event then"); SavageFactions.plugin.log("Guess we will cancel the event then");
event.setCancelled(true); event.setCancelled(true);
event.setUseInteractedBlock(Event.Result.DENY);
} }
@EventHandler @EventHandler