Solved Rainbow Lucky Block

Discussion in 'Plugin Development' started by kemalcik, Feb 28, 2022.

Thread Status:
Not open for further replies.
  1. Offline

    kemalcik

    The armor stand I want has a skull on its head and I want the armor stand to find the block on its head and replace it with another colored glass.

    This Code Not Working.

    Code:
        @SuppressWarnings({ "unlikely-arg-type", "deprecation" })
        @Override
        public void onEnable() {
            System.out.println("&e&lEklenti Baslatildu Usagum Da. &b&lBy: 1Ripeness ");
            this.getCommand("getskull").setExecutor(new CommandExecuter());
            this.getCommand("getskullUUID").setExecutor(new CommandExecuter());
            this.getCommand("tlb").setExecutor(new CommandExecuter());
            this.getCommand("tluckyblock").setExecutor(new CommandExecuter());
          
            Bukkit.getScheduler().scheduleAsyncRepeatingTask(this, new Runnable() {
                @Override
                public void run() {
                  
                    for(World w : getServer().getWorlds()) {
                        for(Entity a : w.getEntities()) {
                            if(a instanceof ArmorStand) {
                                ArmorStand as = (ArmorStand) a;
                                Block b = (Block) as.getLocation().add(0, 1.2, 0).getBlock();
                                if(b.equals(Material.STAINED_GLASS) && as.getEquipment().getHelmet().getItemMeta().getDisplayName() == "§fLucky Block (Rainbow)") {
                                  
                                    if(b.equals(b.getData() == 15)) {
            b.setTypeIdAndData(95, (byte)9, true);
                                    } else if(b.equals(b.getData() == 9)) {
            b.setTypeIdAndData(95, (byte)14, true);
                                    } else if(b.equals(b.getData() == 14)) {
            b.setTypeIdAndData(95, (byte)1, true);
                                    } else if(b.equals(b.getData() == 1)) {
            b.setTypeIdAndData(95, (byte)2, true);
                                    } else if(b.equals(b.getData() == 2)) {
            b.setTypeIdAndData(95, (byte)4, true);
                                    } else if(b.equals(b.getData() == 4)) {
            b.setTypeIdAndData(95, (byte)5, true);
                                    } else if(b.equals(b.getData() == 5)) {
            b.setTypeIdAndData(95, (byte)11, true);
                                    } else if(b.equals(b.getData() == 11)) {
                                        b.setTypeIdAndData(95, (byte)15, true);
                                    }
                                  
                                }
                              
                              
                              
                            }
                        }}
                  
                  
                Bukkit.broadcastMessage("aaA");  
                }
            }, 60, 60);
          
          
          
            Bukkit.getServer().getPluginManager().registerEvents(this, this);
            //getServer().getPluginManager().registerEvents(new AListener(), this);
        }
    
    ok i did it myself.
    Thanks again to those who clicked to help. :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Mar 1, 2022
Thread Status:
Not open for further replies.

Share This Page