Files

31 lines
1016 B
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.
# KlonlanmaLal.js — syncEffects() (satır 420)
[← KlonlanmaLal.js](index.md) · [← Master](../../wiki.md)
```javascript
function syncEffects(owner, clone) {
try {
var src = getMcEntity(owner);
var dst = getMcEntity(clone);
if (!src || !dst || !src.getActivePotionEffects || !dst.addPotionEffect) return;
try { dst.clearActivePotions(); } catch (e1) {}
var it = src.getActivePotionEffects().iterator();
while (it.hasNext()) {
var eff = it.next();
var potion = eff.getPotion();
var duration = eff.getDuration();
var amp = eff.getAmplifier();
var ambient = false;
var particles = true;
try { ambient = eff.getIsAmbient(); } catch (e2) {}
try { particles = eff.doesShowParticles(); } catch (e3) {}
dst.addPotionEffect(new PotionEffect(potion, duration, amp, ambient, particles));
}
} catch (e) {}
}
```