Files

50 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.
# ezoic_viltrumite.js — doHeadbutt() (satır 409)
[← ezoic_viltrumite.js](index.md) · [← Master](../../wiki.md)
Parça 2/5 · [önceki](doHeadbutt.md) · [sonraki](doHeadbutt-3.md)
```javascript
spawnFx(ww, "endRod", hx + Math.cos(a)*0.7, hy + 1 + Math.sin(a)*0.35, hz + Math.sin(a)*0.7, 1, 0, 0, 0, 0);
}
}
if (step % 4 === 0) {
ww.playSound("minecraft:entity.blaze.shoot", hx, hy, hz, 0.5, 2.0);
}
// === ÇARPMA KONTROLÜ ===
var hitSomething = false;
// Blok kontrolü — önde 2 nokta kontrol et
for (var chk = 1; chk <= 2; chk++) {
var ckx = Math.floor(hx + lx * chk);
var cky = Math.floor(hy + eyeH + ly * chk);
var ckz = Math.floor(hz + lz * chk);
try {
var bs = ww.getBlock(ckx, cky, ckz);
if (bs) {
var bid = bs.getBlockId();
if (bid !== "minecraft:air" && bid !== "minecraft:water" && bid !== "minecraft:flowing_water") {
hitSomething = true;
break;
}
}
} catch (e) {}
// Ayak seviyesinde de kontrol
var bsy = ww.getBlock(ckx, Math.floor(hy + ly * chk), ckz);
if (bsy) {
var bidy = bsy.getBlockId();
if (bidy !== "minecraft:air" && bidy !== "minecraft:water" && bidy !== "minecraft:flowing_water") {
hitSomething = true;
break;
}
}
}
// Entity kontrolü
if (!hitSomething) {
var ents = ww.getEntities(hx, hy + 1, hz, 2.5);
for (var ei = 0; ei < ents.size(); ei++) {
var e = ents.get(ei);
```