-
-
Save anonymous/0ee889d2f169210a08d7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package potato.info; | |
import org.bukkit.Bukkit; | |
import org.bukkit.ChatColor; | |
import org.bukkit.entity.Entity; | |
import org.bukkit.entity.IronGolem; | |
import org.bukkit.entity.LivingEntity; | |
import org.bukkit.event.EventHandler; | |
import org.bukkit.event.Listener; | |
import org.bukkit.event.player.PlayerInteractEntityEvent; | |
import org.bukkit.plugin.java.JavaPlugin; | |
public class MenuInv extends JavaPlugin implements Listener { | |
private Menu menu; | |
public void onEnable() { | |
menu = new Menu(this); | |
Bukkit.getServer().getPluginManager().registerEvents(this, this); | |
} | |
@EventHandler | |
public void PlayerRightClick(PlayerInteractEntityEvent event) { | |
if(event.getRightClicked() instanceof IronGolem){ | |
Entity entity = event.getRightClicked(); | |
if (((LivingEntity)entity).getCustomName().equalsIgnoreCase(ChatColor.AQUA + "Info")) { | |
menu.show(event.getPlayer()); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment