The LeftClickBlockEvent class is fired when a player left-clicks at some block.
The LeftClickBlockEvent class is a subtype of the PlayerInteractEvent class and inherits all its properties and functions.
Here is an overview of the LeftClickBlockEvent properties:
Property | Type | read / write |
---|---|---|
hitVec | Vec3 | r |
Below you find short descriptions about each of the properties and some examples about how to use them in your spells.
The exact position the player clicked at.
Creating some particle effect at the left-click hit position.
local queue = Events.collect("LeftClickBlockEvent")
while true do
local event = queue:next()
local v = event.hitVec
spell:execute([[
/particle angryVillager %s %s %s 0 0 0 0 1 true
]], v.x, v.y, v.z)
end