Solved Chest Locking Broken?

Discussion in 'Plugin Development' started by opd02, May 5, 2019.

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


    So I have been doing some work, trying to lock a chest with the .setLock(String) method and its not locking the chest. It is giving no error message or anything in the console, it simply is not locking the chest in the game with the string. I have tried almost everything and I am just about convinced that bukkit has a bug with the locking method. Thoughts?
                    Chest chest = (Chest) p.getTargetBlockExact(100).getState();
                        p.sendMessage(ChatColor.RED + "This chest is already locked!");
                        return true;
                    String pass = args[0].toString();
  2. Offline


    @opd02 Are you sure the code is executed?
  3. Offline


    @KarimAKL Yes, I did test that. I changed it to

    And the message was sent. If you could try it out on your own is see if it works I would appreciate it so much :D I think next I’m going to try different versions of bukkit, see if that works for some reason lol
  4. Offline

    timtower Ninja on the waves Moderator

    @opd02 Add chest.update() to the end of the function.
  5. Offline


    @timtower that was the magical phrase! That did it! Thank you so much! Couldn't find that anywhere!
    timtower likes this.
Thread Status:
Not open for further replies.

Share This Page