Files

42 lines
1.8 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.
# GrimSlash.js — main() (satır 1)
[← GrimSlash.js](index.md) · [← Master](../../wiki.md)
Parça 3/4 · [önceki](main-2.md) · [sonraki](main-4.md)
```javascript
var wz = playerPos.z + fwdZ * ilerlemeMesafe + rightZ * rl;
// sweep partikülü
var sweepType = mappet.getParticleType("sweepAttack");
if (sweepType)
ctx2.getWorld().spawnParticles(sweepType, true, wx, wy, wz, 1, 0, 0, 0, 0);
// blok kırma devam
var bx = Math.floor(wx);
var by = Math.floor(wy);
var bz = Math.floor(wz);
var blockState = ctx2.getWorld().getBlock(bx, by, bz);
if (!blockState) continue;
var blockId = blockState.getBlockId();
if (blockId === "minecraft:air" || blockId === "minecraft:bedrock" || blockId === "minecraft:barrier") continue;
(function(rbx, rby, rbz, rState)
{
ctx2.getWorld().setBlock(mappet.createBlockState("minecraft:air", 0), rbx, rby, rbz);
ctx2.scheduleScript(100, function(ctx3)
{
if (ctx3.getWorld().getBlock(rbx, rby, rbz).getBlockId() === "minecraft:air")
ctx3.getWorld().setBlock(rState, rbx, rby, rbz);
});
})(bx, by, bz, blockState);
}
}
// o bölgedeki oyunculara event
var merkX = playerPos.x + fwdX * ilerlemeMesafe;
var merkY = playerPos.y + 1;
var merkZ = playerPos.z + fwdZ * ilerlemeMesafe;
```