Paste #134185: Sit Command + Sit on Stairs/Slabs

Date: 2025/06/18 21:19:05 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


chair_armorstand:
    type: entity
    debug: false
    entity_type: armor_stand
    mechanisms:
        visible: false
        marker: true
        gravity: false
        arms: false
        base_plate: false
        collidable: false
        equipment: []


sit_command:
    type: command
    debug: false
    name: sit
    description: Sit on the ground.
    usage: /sit
    permission: sit.command
    script:
    - if <player.has_flag[sit_armorstand]>:
      - narrate "<red>You're already sitting."
      - stop
    - if <player.location.below.material.is_solid.not>:
      - narrate "<red>You can't sit down here."
      - stop
    - define location <player.location.center.add[0, -0.5, 0]>
    - spawn chair_armorstand <[location]> save:stand
    - flag <player> sit_armorstand:<entry[stand].spawned_entities.get[1]>
    - mount <player>|<entry[stand].spawned_entities.get[1]>



sit_rightclick_handler:
    type: world
    debug: false
    events:
      on player right clicks block:
      - define loc <context.location>
      - define mat <[loc].block.material>
      - if <[mat].name.contains[slab].not> && <[mat].name.contains[stairs].not>:
        - stop
      - if <player.has_permission[sit.stairs].not>:
        - narrate "<red>You don't have the permission to sit on this."
        - stop
      - if <player.is_sneaking>:
        - stop
      - if <player.has_flag[sit_armorstand]>:
        - stop
      - define location <[loc].center.add[0, 0.05, -0.4]>
      - spawn chair_armorstand <[location]> save:stand
      - flag <player> sit_armorstand:<entry[stand].spawned_entities.get[1]>
      - mount <player>|<entry[stand].spawned_entities.get[1]>

sit_unsit_handler:
    type: world
    debug: false
    events:
      on player starts sneaking:
      - if <context.state.not>:
        - stop
      - if <player.flag[sit_armorstand].exists.not>:
        - stop
      - define stand <player.flag[sit_armorstand]>
      - if <[stand].is_spawned>:
          - remove <[stand]>
      - flag <player> sit_armorstand:!