1.8 KiB
1.8 KiB
potion_rain.js — q() (satır 160)
if (!(pi >= 0 && pi < POTIONS.length)) pi = 0;
var owner = String(c.getValue("o") || "");
var nbt = '{Potion:{id:"minecraft:splash_potion",Count:1b,tag:{Potion:"' + potionAt(pi) + '"}},' +
'Motion:[0d,-0.3d,0d],ownerName:' + q(owner) + '}';
try { w.spawnEntity("minecraft:potion", pos.x, pos.y + 0.4, pos.z, mappet.createCompound(nbt)); } catch (e3) {}
}
}
// =====================================================================
// YAGMUR
// =====================================================================
function startRain(c, p) {
var name = p.getName();
var t = now();
var busy = mappet.get(G_BUSY + name);
if (busy !== null && busy !== undefined && t < Number(busy)) {
var left = Math.max(1, Math.ceil((Number(busy) - t) / 1000));
p.sendActionBar("§cYagmur hazir degil §8| §7" + left + " sn §8(menude Durdur)");
return false;
}
var cfg = readConfig(p);
var k = cfg.kind;
if (k.type === "skin" && !cfg.skin) {
p.sendActionBar("§cSkin bos §8| §7egilip sag tik > Skin sekmesi");
return false;
}
if (k.type === "custom" && !cfg.morph) {
p.sendActionBar("§cMorph NBT bos §8| §7egilip sag tik > Skin sekmesi");
return false;
}
var pot = POTIONS[cfg.pot];
var dangerous = k.harm || (carriesPotion(k, cfg) && pot.harmful);
var safe = (cfg.mode === 1 && dangerous) ? (k.safe || SAFE_RADIUS) : 0;
if (safe > 0 && cfg.shape === 0 && cfg.radius < safe + 2) cfg.radius = safe + 2;
var totalTicks = cfg.timed ? cfg.duration * 20 : Math.ceil(cfg.count / cfg.rate);