Home / Region

region:contains()

region:contains(x, y, z) region:contains(entity)

Checks whether block coordinates or a position-bearing player/entity wrapper are inside the inclusive region bounds. Values are floored to block coordinates.

Parameters

NameTypeDescription
x, y, z or entitynumber or wrapper tableSupply all three coordinates, or a wrapper that provides pos().

Returns

A boolean indicating whether the target is inside.

Example

on('move', function(e)
  if myRegion:contains(e.player) then
    e.player:send("You entered the zone!")
  end
end)