35 lines
1.2 KiB
Markdown
35 lines
1.2 KiB
Markdown
# GrimSlash.js — main() (satır 1)
|
||
|
||
[← GrimSlash.js](index.md) · [← Master](../../wiki.md)
|
||
|
||
Parça 4/4 · [önceki](main-3.md)
|
||
|
||
```javascript
|
||
var entities = ctx2.getWorld().getEntities(merkX, merkY, merkZ, genislikX + 1);
|
||
for (var i = 0; i < entities.size(); i++)
|
||
{
|
||
var e = entities.get(i);
|
||
if (!e || !e.isLivingBase()) continue;
|
||
if (e.isSame(player)) continue;
|
||
|
||
var uid = e.isPlayer ? (e.isPlayer() ? e.getName() : null) : null;
|
||
if (!uid) continue;
|
||
if (hittenler[uid]) continue;
|
||
|
||
hittenler[uid] = true;
|
||
ctx2.executeCommand("mp event trigger " + uid + " grimslashbig");
|
||
}
|
||
|
||
kesikAdim++;
|
||
ctx2.scheduleScript(1, kesikLoop);
|
||
}
|
||
|
||
ctx.scheduleScript(1, kesikLoop);
|
||
|
||
// ses efekti
|
||
world.playSound("minecraft:entity.player.attack.sweep", playerPos.x, playerPos.y, playerPos.z, 2.0, 0.8);
|
||
world.playSound("minecraft:entity.lightning.thunder", playerPos.x, playerPos.y, playerPos.z, 1.5, 1.2);
|
||
});
|
||
}
|
||
```
|