Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler(priority = EventPriority.MONITOR)
- public void onSignInteract(PlayerInteractEvent event) {
- if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
- if ((event.getClickedBlock() != null) && (event.getClickedBlock().getType() == Material.SKULL)) {
- Skull sk = (Skull) event.getClickedBlock().getState();
- //If the skull is a player do this
- if (sk.getSkullType() == SkullType.PLAYER) {
- event.getPlayer().sendMessage(ChatColor.GRAY + "Head of " + ChatColor.WHITE + sk.getOwner() + ChatColor.YELLOW + ".");
- }
- //If the skull is NOT a player
- if (!sk.getSkullType() == SkullType.PLAYER) {
- event.getPlayer().sendMessage(ChatColor.GRAY + "Head of " + ChatColor.WHITE + sk.getOwner() + ChatColor.YELLOW + ".");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement