#ScriptVer 1.3.4 #Author Icecapade #Date 2021-03-05 simplesit: type: world debug: false data: config: #If false, players can not sit on corner stairs sit-on-corners: true #If true, players can sit on any stair even if they can not reach the location players-reach-any-block: false events: after player right clicks *_stairs with:air: - define location - if || || <[location].material.half> == TOP || <[location].above.material.is_solid>: - stop - if !: - if <[location].material.shape> != STRAIGHT: - stop - if !: - if <[location].y.sub[]> >= 1.5 || !: - stop - choose <[location].material.direction>: - case NORTH: - spawn <[location].add[0.5,-1.2,0.6].with_yaw[0].with_pitch[0]> armor_stand[visible=false;collidable=false;gravity=false] save:armor - case SOUTH: - spawn <[location].add[0.5,-1.2,0.4].with_yaw[180].with_pitch[0]> armor_stand[visible=false;collidable=false;gravity=false] save:armor - case WEST: - spawn <[location].add[0.6,-1.2,0.5].with_yaw[-90].with_pitch[0]> armor_stand[visible=false;collidable=false;gravity=false] save:armor - case EAST: - spawn <[location].add[0.4,-1.2,0.5].with_yaw[90].with_pitch[0]> armor_stand[visible=false;collidable=false;gravity=false] save:armor - mount | - definemap map entity: location:<[location]> - flag server simplesit.sitters:->: - flag simplesit.armorstand:<[map]> after player exits vehicle flagged:simplesit: - define location - inject simplesitcancel - teleport <[location]> on player quits flagged:simplesit: - inject simplesitcancel simplesitcancel: type: task debug: false script: - define map - define chunk <[map].get[location].chunk> - if !<[chunk].is_loaded>: - chunkload <[chunk]> duration:1s - remove <[map].get[entity]> - flag simplesit:! - flag server simplesit.sitters:<-: simplesitcommand: type: command debug: false name: simplesit description: only used for debug purposes and error handling usage: /simplesit [kick/list] (player) permission: simplesit.admin tab completions: 1: kick|list 2: ].if_false[]> script: - choose : - case 1: - if != list: - narrate ]> format:simplesitformat - stop - if : - narrate "Nobody sits." format:simplesitformat - stop - define player_list - foreach <[player_list]> as:player: - clickable simplesitteleport def:<[player]> for: save:teleport_<[player]> - narrate "Players sitting:" format:simplesitformat - narrate "<[player_list].parse_tag[<&n><[parse_value].name.on_click[].command>].on_hover[Teleport to <[parse_value].name>'s sit location]>].comma_separated>" - case 2: - if != kick: - narrate ]> format:simplesitformat - stop - define player ].if_null[null]> - if <[player]> == null: - narrate "The player is not valid!" format:simplesitformat - stop - if !<[player].has_flag[simplesit]>: - narrate "The player does not sit." format:simplesitformat - stop - announce "[SimpleSit] has removed ARMOR_STAND[<[player].flag[simplesit.armorstand].get[entity]>] at location " to_console - run simplesitcancel player:<[player]> - narrate "<[player].name> is able to sit again. Lookup your console for possible errors." format:simplesitformat - default: - narrate ]> format:simplesitformat simplesitteleport: type: task debug: false definitions: player script: - teleport <[player].flag[simplesit.armorstand].get[location]> - narrate "You've been teleported to <[player].name>'s sit location." format:simplesitformat simplesitformat: type: format debug: false format: [SimpleSit] simplesitdata: type: data debug: false help: - Syntax<&co> - /simplesit list - list all sitting players - /simplesit kick [player] - removes the armorstand from the player and clears the data