Solved Piston Event

Discussion in 'Plugin Development' started by Dablakbandit, Dec 8, 2013.

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

    Dablakbandit

    Hi i was wondering if it was possible to stop a piston from pulsing? so like if a piston extends it would cancel all the retract event for the piston for "x" amount of ticks. How would this be done?

    Thanks,
    Dablakbandit
     
  2. Offline

    NinjaWAffles

  3. Offline

    Dablakbandit

    NinjaWAffles
    Yes, but i was wondering how to use this in a way to get what i want.

    E.g: If the piston extends i want it to be unabed to retract for "x" amount of ticks.
    If the piston retracts i want it to be unable to extend for "x" amount of ticks.

    Thanks,
    Dablakbandit

    bump

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
  4. Offline

    Dablakbandit

  5. listen for a pistonExtendEvent and put that piston's location in a list and remove it from the list after x amount of ticks. In the retractEvent check if the piston's location is in the list. If it is --> cancel the event. If not --> do nothing
     
  6. Offline

    Dablakbandit

    Sgt_Tailor
    Okay so i can add it to a list, but how do i remove it after x amount of ticks?

    Thanks,
    Dablakbandit
     
  7. Offline

    rocket138

    When you add it to the list:

    Code:java
    1. Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable(){
    2.  
    3.  
    4. @Override
    5. public void run() {
    6. //remove it from the list here
    7.  
    8. }
    9. }, *time in ticks*);
    10.  
     
Thread Status:
Not open for further replies.

Share This Page