Date: 2024/06/13 10:12:24 UTC-07:00
Type: Denizen Script
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