1.15.2 ItemFrame Rotation Not Counting

Discussion in 'Spigot Plugin Development' started by NocturnalDev, Jan 21, 2020.

  1. Hello,

    I'm trying to count the turns of my item frame:

    It only fires till test.


    Code (Java):

    private int turns = 0;

    @EventHandler
        public void onPlayerInteract(PlayerInteractEntityEvent event) {
            if (event.getPlayer().getWorld().getName().equals(Lang.worldName)) {
                Bukkit.broadcastMessage("te");

                Location loc = new Location(Bukkit.getWorld(Lang.worldName), -82, 74, -21);

                if (event.getRightClicked() instanceof ItemFrame) {

                    Bukkit.broadcastMessage("test");

                    if (event.getRightClicked().getLocation().equals(loc) {
                        Bukkit.broadcastMessage("test2");
                        if (turns == 8) {
                            turns = 0;
                            alertRemainingPlayers(Lang.wodlPrefix + "§7loc: " + turns);

                        } else {
                            alertRemainingPlayers(Lang.wodlPrefix + "§l7oc: " + turns);
                            turns++;
                        }
                    }
    Thank you.
     
    #1 NocturnalDev, Jan 21, 2020
    Last edited: Jan 21, 2020
  2. md_5

    Administrator Developer

    Well obviously loc is not what you think it is, print it and see
     
  3. (Don't print loc, print event.getRightClicked().getLocation())
     
  4. Print both using the method toString()