Paste #123709: carpetplacer

Date: 2024/06/13 10:12:24 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15


carpetplacer:
    type: world
    debug: false
    events:
      on player right clicks !air with:*_carpet:
      - define target <player.cursor_on>
      # "direction" gives north, south, etc. and "vector" gives a vector object, while "xyz" converts it to coordinates. So output is sth. like .add[0,0,1]
      - define placeloc <[target].add[<player.eye_location.ray_trace.direction.vector.xyz>]>
      - if <[placeloc].material.name> != air:
        - stop
      - else:
        - modifyblock <context.item.material> <[placeloc]> no_physics
        - playsound <player> sound:block_wool_place
        - if <player.gamemode> == survival:
          - take iteminhand quantity:1