Preventing players from moving item in itemframe

Discussion in 'Plugin Development' started by OppositeGamer, Dec 31, 2012.

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

    OppositeGamer

    Is there any method for this? Or is it playerinteractevent? Thanks!
     
  2. Offline

    tommycake50

    playerinteractevent
     
  3. Offline

    fireblast709

    PlayerInteractEntityEvent (as ItemFrame is an entity)
     
  4. Offline

    OppositeGamer

    Then shouldnt this work?

    Code:
        @EventHandler
        public void onInteract(PlayerInteractEvent evt)
        {
            if(evt.getPlayer().isOp())
            {
               
            }
            else
            {
                evt.setCancelled(true);
            }
        }
        
     
  5. Offline

    tommycake50

    dont do that that will cancel all interact events for non op's.
     
  6. Offline

    OppositeGamer

    I know, its what I want it to do. Its a minigame no worries :) Im just wandering should that work? Because it doesnt.
     
  7. Offline

    tommycake50

    ehh.
    hmm.
    idk should do.
     
  8. Offline

    fireblast709

    ^ this maybe? Try broadcasting in both to see which one is called
     
  9. Offline

    OppositeGamer

    kk

    Still no work, nor did it call

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 30, 2016
  10. Offline

    fireblast709

    one of both (PlayerInteractEvent or PlayerInteractEntityEvent) should have been called
     
  11. Offline

    OppositeGamer

    kk Ill try both methods
     
Thread Status:
Not open for further replies.

Share This Page