# MercanRey5.js — applyPotion() (satır 27) [← MercanRey5.js](index.md) · [← Master](../../wiki.md) ```javascript function applyPotion(entity, ids, duration, amplifier) { if (entity == null || !entity.isLivingBase()) { return; } for (var i = 0; i < ids.length; i++) { var potion = mappet.getPotion(ids[i]); if (potion != null) { entity.applyPotion(potion, duration, amplifier, false); return; } } } ```