Paste #124979: crop growth

Date: 2024/07/25 13:38:18 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


        on beetroots grows location_flagged:crop:
        - define location <context.location>
        - define crop <[location].flag[crop]>
        - define age <context.material.age>
        - define type <[location].flag[type]>
        - if <[type]> == tree:
          - define offset 1
        - else:
          - define offset 0


        - remove <[location].flag[crop_entity]>
        - flag <[location]> crop_entity:!
        - if <[type]> == bush:
          - if <[age]> < 3:
            - spawn ITEM_DISPLAY[item=Crop_Bush_<[age]>;scale=1,1,1] <[location].above[<[offset].add[0.45]>].left[0.5].forward[0.5]> save:crop_entity
          - else:
            - spawn ITEM_DISPLAY[item=Crop_<[crop]>_<[age]>;scale=1,1,1] <[location].above[<[offset].add[0.45]>].left[0.5].forward[0.5]> save:crop_entity
        - else:
          - spawn ITEM_DISPLAY[item=Crop_<[crop]>_<[age]>;scale=1,1,1] <[location].above[<[offset].add[0.45]>].left[0.5].forward[0.5]> save:crop_entity
          - if <[type]> == bark:
            - look <entry[crop_entity].spawned_entity> yaw:<[location].flag[player_position].yaw.round_to_precision[90]>
        - flag <[location]> crop_entity:<entry[crop_entity].spawned_entity>