Files

42 lines
1.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# MercanRey3.js — findAffected() (satır 130)
[← MercanRey3.js](index.md) · [← Master](../../wiki.md)
```javascript
function findAffected(world, state)
{
var entities = world.getEntities(state.x - RADIUS, state.y - RADIUS, state.z - RADIUS, state.x + RADIUS, state.y + RADIUS, state.z + RADIUS);
var affected = {};
for (var i = 0; i < entities.size(); i++)
{
var entity = entities.get(i);
if (entity == null || !entity.isLivingBase() || String(entity.getUniqueId()) === String(state.caster))
{
continue;
}
if (entity.getDimension() !== Number(state.dimension))
{
continue;
}
var pos = entity.getPosition();
if (distanceSqPos(pos, state.x, state.y, state.z) <= RADIUS * RADIUS)
{
affected[String(entity.getUniqueId())] = true;
slowInside(entity);
if (entity.isPlayer())
{
entity.sendActionBar("Insignia de Caballero: reflekslerin agirlasiyor.");
}
}
}
return affected;
}
```