Paste #62525: Ride the MOVEing Chickens!

Date: 2019/12/04 20:24:54 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


RideAllTheChickens:
  type: world
  debug: false
  events:
    on player right clicks chicken:
    - if <context.entity.has_passenger>:
        - stop
    - mount <player>|<context.entity> <context.entity.location>
    - adjust <context.entity> has_ai:false
    - wait 1t
    - actionbar "Press LSHIFT for TURBO SPEEEED"
    on player steers chicken:
    - define looking <player.location.direction.vector.with_y[0].div[3]>
    - define forward <[looking].mul[<context.forward>]>
    - define sideways <[looking].rotate_around_y[<el@90.to_radians>].mul[<context.sideways>]>
    - define speed 1
    - define upward <player.flag[RideAllTheChickens.JumpingVelocity]||0>
    - flag player RideAllTheChickens.JumpingVelocity:<[upward].sub[0.06]>
    - if <[upward]> <= 0 && <context.entity.location.sub[0,0.01,0].material.is_solid>:
        - flag player RideAllTheChickens.JumpingVelocity:0
        - define upward 0
        - if <context.jump>:
            - flag player RideAllTheChickens.JumpingVelocity:0.5
    - if <context.dismount>:
        - determine passively cancelled
        - define speed 10
    - define speed <tern[<context.dismount>]:10||1>
    - define velocity <[forward].add[<[sideways]>].mul[<[speed]>].add[0,<[upward]>,0]>
    - adjust <context.entity> move:<[velocity]>
    - if <[velocity].vector_length> > 0.01:
        - look <context.entity> <context.entity.eye_location.add[<[velocity]>]>