Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.junkstyle.chicken;
- import java.util.ArrayList;
- import java.util.HashMap;
- import org.bukkit.Bukkit;
- import org.bukkit.Location;
- import org.bukkit.Material;
- import org.bukkit.Sound;
- import org.bukkit.block.Block;
- import org.bukkit.entity.LightningStrike;
- import org.bukkit.entity.Player;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.Listener;
- import org.bukkit.event.block.Action;
- import org.bukkit.event.entity.EntityDamageByEntityEvent;
- import org.bukkit.event.player.PlayerInteractEvent;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.inventory.ShapedRecipe;
- import org.bukkit.inventory.meta.ItemMeta;
- import org.bukkit.inventory.meta.SkullMeta;
- import org.bukkit.plugin.java.JavaPlugin;
- import org.bukkit.potion.PotionEffect;
- import org.bukkit.potion.PotionEffectType;
- import net.md_5.bungee.api.ChatColor;
- public class Main extends JavaPlugin implements Listener {
- @SuppressWarnings("deprecation")
- public void onEnable() {
- Bukkit.getPluginManager().registerEvents(this, this);
- ItemStack lseed = new ItemStack(Material.SEEDS);
- ItemMeta lmeta = lseed.getItemMeta();
- lmeta.setDisplayName(ChatColor.BOLD + "" + ChatColor.GOLD + "LEGENDARY SEED");
- ArrayList<String> lore = new ArrayList<String>();
- lore.add(ChatColor.LIGHT_PURPLE + "Use this item to transform into chicken man!");
- lmeta.setLore(lore);
- lseed.setItemMeta(lmeta);
- ShapedRecipe lseedc = new ShapedRecipe(lseed);
- lseedc.shape("$$$", "$@$", "$$$");
- lseedc.setIngredient('@', Material.NETHER_STAR);
- lseedc.setIngredient('$', Material.SEEDS);
- getServer().addRecipe(lseedc);
- ItemStack skull = new ItemStack(397, 1, (short) 3);
- SkullMeta meta = (SkullMeta) skull.getItemMeta();
- meta.setOwner("Junkstyle");
- skull.setItemMeta(meta);
- meta.setDisplayName(ChatColor.GOLD + "" + ChatColor.BOLD + "Chicken's Man Head's");
- skull.setItemMeta(meta);
- }
- HashMap<Player, Long> cooldown = new HashMap<>();
- @SuppressWarnings("deprecation")
- @EventHandler
- public void onClick(PlayerInteractEvent e) {
- if(e.getAction() == Action.LEFT_CLICK_BLOCK) {
- if (e.getClickedBlock().getType().equals(Material.GOLD_BLOCK)) {
- Player player = e.getPlayer();
- Location ploc = player.getLocation();
- Block block = ploc.getBlock();
- //Custom Items
- //Custom Head
- ItemStack skull = new ItemStack(397, 1, (short) 3);
- SkullMeta meta = (SkullMeta) skull.getItemMeta();
- meta.setOwner("Junkstyle");
- skull.setItemMeta(meta);
- meta.setDisplayName(ChatColor.GOLD + "" + ChatColor.BOLD + "Chicken's Man Head's");
- //Legendary Seed
- ItemStack lseed = new ItemStack(Material.SEEDS);
- ItemMeta lmeta = lseed.getItemMeta();
- lmeta.setDisplayName(ChatColor.BOLD + "" + ChatColor.GOLD + "LEGENDARY SEED");
- ArrayList<String> lore1 = new ArrayList<String>();
- lore1.add(ChatColor.LIGHT_PURPLE + "Use this item to transform into chicken man!");
- lmeta.setLore(lore1);
- lseed.setItemMeta(lmeta);
- ItemStack fea1 = new ItemStack(Material.FEATHER);
- ItemMeta lmeta1 = fea1.getItemMeta();
- lmeta1.setDisplayName(ChatColor.BOLD + "" + ChatColor.GOLD + "You are free!");
- ArrayList<String> lore32 = new ArrayList<String>();
- lore32.add(ChatColor.LIGHT_PURPLE + "Click left click or right to get levitation!");
- lmeta1.setLore(lore32);
- fea1.setItemMeta(lmeta1);
- ItemStack jum = new ItemStack(Material.QUARTZ);
- ItemMeta lmet = jum.getItemMeta();
- lmet.setDisplayName(ChatColor.BOLD + "" + ChatColor.GOLD + "Hm, Jump like a cangaroo!");
- ArrayList<String> lore12 = new ArrayList<String>();
- lore12.add(ChatColor.LIGHT_PURPLE + "Click left or right click to get jump boost!");
- lmet.setLore(lore12);
- jum.setItemMeta(lmet);
- ItemStack str = new ItemStack(Material.BLAZE_POWDER);
- ItemMeta lmet1 = str.getItemMeta();
- lmet1.setDisplayName(ChatColor.BOLD + "" + ChatColor.GOLD + "Chicken is powerful!");
- ArrayList<String> lore2 = new ArrayList<String>();
- lore2.add(ChatColor.LIGHT_PURPLE + "Click left or right click to get super power!");
- lmet1.setLore(lore2);
- str.setItemMeta(lmet1);
- lmet1.setUnbreakable(true);
- Block block2 = block.getRelative(0, -1, 0); // gold
- Block block3 = block.getRelative(1, -1, 0); // stairs
- Block block4 = block.getRelative(-1, -1, 0);// stairs
- Block block5 = block.getRelative(0, -1, 1);// stairs
- Block block6 = block.getRelative(0, -1, -1);// stairs
- Block block7 = block.getRelative(1, -1, 1); // end rod
- Block block8 = block.getRelative(1, -1, -1);// end rod
- Block block9 = block.getRelative(-1, -1, 1);// end rod
- Block block10 = block.getRelative(-1, -1, -1);// end rod
- Block block11 = block.getRelative(1, 0, 1);// end rod
- Block block12 = block.getRelative(1, 0, -1);// end rod
- Block block13 = block.getRelative(-1, 0, 1);// end rod
- Block block14 = block.getRelative(-1, 0, -1);// end rod
- Block block15 = block.getRelative(1, 1, 1); // sea shit
- Block block16 = block.getRelative(1, 1, -1);// sea shit
- Block block17 = block.getRelative(-1, 1, 1);// sea shit
- Block block18 = block.getRelative(-1, 1, -1);// sea shit
- if (block2.getType() == Material.GOLD_BLOCK &&
- block3.getType() == Material.QUARTZ_STAIRS &&
- block4.getType() == Material.QUARTZ_STAIRS &&
- block5.getType() == Material.QUARTZ_STAIRS &&
- block6.getType() == Material.QUARTZ_STAIRS &&
- block7.getType() == Material.END_ROD &&
- block8.getType() == Material.END_ROD &&
- block9.getType() == Material.END_ROD &&
- block10.getType() == Material.END_ROD &&
- block11.getType() == Material.END_ROD &&
- block12.getType() == Material.END_ROD &&
- block13.getType() == Material.END_ROD &&
- block14.getType() == Material.END_ROD &&
- block15.getType() == Material.SEA_LANTERN &&
- block16.getType() == Material.SEA_LANTERN &&
- block17.getType() == Material.SEA_LANTERN &&
- block18.getType() == Material.SEA_LANTERN ) {
- if (player.getInventory().contains(skull)) {
- player.sendMessage(ChatColor.GOLD + "You are already super mega extra duper super Chicken Man!");
- }
- if (player.getInventory().getHelmet() != null ) {
- player.sendMessage(ChatColor.RED + "Please remove your armor before using the temple!");
- } else {
- if (player.getInventory().getItemInMainHand().isSimilar(lseed)) {
- if (player.getInventory().getItemInMainHand().getAmount() < 2) {
- player.getInventory().remove(lseed);
- player.getInventory().setHelmet(skull);
- player.addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION,200,3));
- player.addPotionEffect(new PotionEffect(PotionEffectType.WEAKNESS,200,3));
- player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS,200,3));
- player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW,200,3));
- player.playSound(ploc, Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 2f, 1f);
- player.getInventory().addItem(fea1);
- player.getInventory().addItem(str);
- player.getInventory().addItem(jum);
- } else {
- player.sendMessage(ChatColor.RED + "To use the temple, put 1 Legendary Seed Into your hand!");
- }
- }else {
- player.sendMessage(ChatColor.RED + "You have to handle legendary seed in main hand!");
- player.sendMessage(ChatColor.RED + "to transform into Chicken Man!");
- }
- }
- }
- }
- } else {
- Player player = (Player) e.getPlayer();
- ItemStack fea1 = new ItemStack(Material.FEATHER);
- ItemMeta lmeta1 = fea1.getItemMeta();
- lmeta1.setDisplayName(ChatColor.BOLD + "" + ChatColor.GOLD + "You are free!");
- ArrayList<String> lore32 = new ArrayList<String>();
- lore32.add(ChatColor.LIGHT_PURPLE + "Click left click or right to get levitation!");
- lmeta1.setLore(lore32);
- fea1.setItemMeta(lmeta1);
- ItemStack jum = new ItemStack(Material.QUARTZ);
- ItemMeta lmet = jum.getItemMeta();
- lmet.setDisplayName(ChatColor.BOLD + "" + ChatColor.GOLD + "Hm, Jump like a cangaroo!");
- ArrayList<String> lore12 = new ArrayList<String>();
- lore12.add(ChatColor.LIGHT_PURPLE + "Click left or right click to get jump boost!");
- lmet.setLore(lore12);
- jum.setItemMeta(lmet);
- ItemStack str = new ItemStack(Material.BLAZE_POWDER);
- ItemMeta lmet1 = str.getItemMeta();
- lmet1.setDisplayName(ChatColor.BOLD + "" + ChatColor.GOLD + "Chicken is powerful!");
- ArrayList<String> lore2 = new ArrayList<String>();
- lore2.add(ChatColor.LIGHT_PURPLE + "Click left or right click to get super power!");
- lmet1.setLore(lore2);
- str.setItemMeta(lmet1);
- lmet1.setUnbreakable(true);
- // power
- if (player.getInventory().getItemInMainHand().isSimilar(str)) {
- if (player.getHealth() > 8) {
- if (!player.hasPotionEffect(PotionEffectType.DAMAGE_RESISTANCE)) {
- if (!player.hasPotionEffect(PotionEffectType.INCREASE_DAMAGE)) {
- player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE,400,0));
- player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE,400,1));
- int playerh = (int) (player.getHealth() - 8);
- player.setHealth(playerh);
- } else {
- player.removePotionEffect(PotionEffectType.INCREASE_DAMAGE);
- player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE,400,1));
- player.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE);
- player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE,400,0));
- int playerh = (int) (player.getHealth() - 8);
- player.setHealth(playerh);
- }
- } else {
- player.removePotionEffect(PotionEffectType.INCREASE_DAMAGE);
- player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE,140,1));
- player.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE);
- player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE,140,0));
- int playerh = (int) (player.getHealth() - 8);
- player.setHealth(playerh);
- }
- } else if (player.getHealth() <= 8) {
- player.sendMessage(ChatColor.RED + "you cannot use this skill, because your hp is very low!");
- }
- }
- //fea
- if (player.getInventory().getItemInMainHand().isSimilar(fea1)) {
- if (player.getHealth() > 2) {
- if (!player.hasPotionEffect(PotionEffectType.LEVITATION)) {
- player.addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION,60,2));
- int playerh = (int) (player.getHealth() - 2);
- player.setHealth(playerh);
- } else {
- player.removePotionEffect(PotionEffectType.LEVITATION);
- player.addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION,60,2));
- int playerh = (int) (player.getHealth() - 2);
- player.setHealth(playerh);
- }
- } else if (player.getHealth() <= 2) {
- player.sendMessage(ChatColor.RED + "you cannot use this skill, because your hp is very low!");
- }
- }
- //Cangaroo
- if (player.getInventory().getItemInMainHand().isSimilar(jum)) {
- if (player.getHealth() > 6) {
- if (!player.hasPotionEffect(PotionEffectType.JUMP)) {
- if (!player.hasPotionEffect(PotionEffectType.SPEED)) {
- player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP,220,2));
- player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,220,1));
- int playerh = (int) (player.getHealth() - 6);
- player.setHealth(playerh);
- } else {
- player.removePotionEffect(PotionEffectType.SPEED);
- player.removePotionEffect(PotionEffectType.JUMP);
- player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP,220,2));
- player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,220,1));
- int playerh = (int) (player.getHealth() - 6);
- player.setHealth(playerh);
- }
- } else {
- player.removePotionEffect(PotionEffectType.SPEED);
- player.removePotionEffect(PotionEffectType.JUMP);
- player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP,220,2));
- player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,220,1));
- int playerh = (int) (player.getHealth() - 6);
- player.setHealth(playerh);
- }
- } else if (player.getHealth() <= 6) {
- player.sendMessage(ChatColor.RED + "you cannot use this skill, because your hp is very low!");
- }
- }
- }
- }
- @EventHandler
- public void lightningdamage(EntityDamageByEntityEvent event) {
- if(event.getDamager() instanceof LightningStrike){
- event.setDamage(0);
- }
- }
- }
Add Comment
Please, Sign In to add comment