1.9 KiB
IScriptEntity.unlockRotation
Parça 13/17 · önceki · sonraki
subject.applyPotion(slowness, 200, 1, false);
Parameters: potion - Potion that should be applied. duration - Duration of the effect in ticks (20 ticks = 1 second). amplifier - How strong is potion effect. particles - Whether potion effect's particles should be emitted.
hasPotion
boolean hasPotion(Potion potion)
Check whether given potion effect is present on this entity.
Attention: potion effects work only with living base entities, so check for isLivingBase()! You can get the potion effect using IScriptFactory.getPotion(String).
var slowness = mappet.getPotion("slowness"); var subject = c.getSubject();
if (subject.hasPotion(slowness)) {
subject.send("You're kind of slow, my dude..."); }
removePotion
boolean removePotion(Potion potion)
Remove given potion effect from this entity.
Attention: potion effects work only with living base entities, so check for isLivingBase()! You can get the potion effect using IScriptFactory.getPotion(String).
var slowness = mappet.getPotion("slowness"); var subject = c.getSubject();
if (subject.removePotion(slowness)) { subject.send("I made you faster, no need to thank me ;)"); }
Returns: true if there was effect, and it was successfully removed, false if had no given effect present.
clearPotions
void clearPotions()
Remove all potion effects from this entity.
Attention: potion effects work only with living base entities, so check for isLivingBase()! You can get the potion effect using IScriptFactory.getPotion(String).
var subject = c.getSubject();
subject.clearPotions(); subject.send("You've been freed from all potion effects!");
getStates
IMappetStates getStates()