Protected constructorAdds a callback that will be called when a piston expands or retracts.
pistonEvent.ts
         let canceled = false;
         const pistonLoc = new mc.BlockLocation(
           Math.floor(targetLocation.x) + 1,
           Math.floor(targetLocation.y) + 2,
           Math.floor(targetLocation.z) + 1
         );
         const pistonCallback = mc.world.events.beforePistonActivate.subscribe((pistonEvent: mc.BeforePistonActivateEvent) => {
           if (pistonEvent.piston.location.equals(pistonLoc)) {
             log("Cancelling piston event");
             pistonEvent.cancel = true;
             canceled = true;
           }
         });
Adds a callback that will be called when a piston expands or retracts.
pistonEvent.ts
         let canceled = false;
         const pistonLoc = new mc.BlockLocation(
           Math.floor(targetLocation.x) + 1,
           Math.floor(targetLocation.y) + 2,
           Math.floor(targetLocation.z) + 1
         );
         const pistonCallback = mc.world.events.beforePistonActivate.subscribe((pistonEvent: mc.BeforePistonActivateEvent) => {
           if (pistonEvent.piston.location.equals(pistonLoc)) {
             log("Cancelling piston event");
             pistonEvent.cancel = true;
             canceled = true;
           }
         });
Removes a callback from being called when a piston expands or retracts.
This function can throw errors.
Manages callbacks that are connected to piston activations.