How to open fence gate without redstone and hands use signclick?

Discussion in 'Plugin Development' started by scherlokholmes88, Feb 7, 2016.

Thread Status:
Not open for further replies.
  1. When clicking on the subject plate made using command
    /give scherlokholmes 339 64 0 {ench:[{id:0,lvl:0}],display:{Name:"MetroTicket"}}
    should be checked for this item, if it is the open gate, pick up the item, keep open until the player through the gate is not to be held, and then immediately close.
     
  2. Offline

    pie_flavor

    @scherlokholmes88 It is very difficult to understand what you are saying, but I think I got it.
    Listen for a PlayerInteractEvent. If they are clicking on the fence gate, get the BlockState and get its MaterialData. Cast the MaterialData to Gate, and do setOpen(true). Start a BukkitTask that runs every tick, which checks if the player is no longer in that block, and if so, sets it back to closed and cancels itself.
     
Thread Status:
Not open for further replies.

Share This Page