Skip to content

Instantly share code, notes, and snippets.

@Azuxul
Created November 19, 2015 22:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Azuxul/8a208184b320609b599b to your computer and use it in GitHub Desktop.
Save Azuxul/8a208184b320609b599b to your computer and use it in GitHub Desktop.
@EventHandler
public void onBlockPlace(BlockPlaceEvent event) {
Player recucitePlayer;
if(event.getItemInHand().getType().equals(Material.SKULL_ITEM)) {
SkullMeta meta = (SkullMeta)
event.getItemInHand().getItemMeta();
String owner = meta.getOwner();
for(Player player : Bukkit.getOnlinePlayers())
if(player.getName().equalsIgnoreCase(owner)){
recucitePlayer = player;
break;
}
recuciteplayer.setGamemode(Gamemode.SURVIVAL);
}
}
// Azuxul 2015 for MP twitter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment