Files

34 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.
# gojo_purple.js — main() (satır 9)
[← gojo_purple.js](index.md) · [← Master](../../wiki.md)
Parça 10/14 · [önceki](main-9.md) · [sonraki](main-11.md)
```javascript
var meta = blockState.getMeta();
blockDestroyedThisTick = true;
// 1. Bloğu geçici olarak havaya uçur (Air yap)
world.setBlock(airState, x, y, z);
// 2. Fırlayan blok efekti (Falling Block) oluştur ve fırlat
var falling = world.summonFallingBlock(x + 0.5, y + 0.5, z + 0.5, blockId, meta);
if (falling) {
var fdist = Math.sqrt(dx*dx + dy*dy + dz*dz);
if (fdist > 0.01) {
var flingForce = 0.5 + Math.random() * 0.5;
falling.addMotion(
(dx / fdist) * flingForce + (Math.random() - 0.5) * 0.2,
(dy / fdist) * flingForce + 0.3 + Math.random() * 0.3,
(dz / fdist) * flingForce + (Math.random() - 0.5) * 0.2
);
}
// Yere düşüp bloğa dönüşmesini önlemek için 25 tick sonra sil
(function(fb) {
ctx.scheduleScript(25, function(c) {
fb.remove();
});
})(falling);
}
```