Useful Functions - ThreeTAG/Palladium GitHub Wiki

Superpower Util

superpowerUtil.setSuperpower(LivingEntity entity, ResourceLocation powerId)
Sets the entity's superpowers to just the given one

superpowerUtil.setSuperpowerIds(LivingEntity entity, ResourceLocation... powerIds)
Sets the entity's superpowers to the given ones

superpowerUtil.hasSuperpower(LivingEntity entity, ResourceLocation powerId)
Tests if the entity has the given superpower

superpowerUtil.addSuperpower(LivingEntity entity, ResourceLocation powerId)
Adds a superpower to the entity

superpowerUtil.removeSuperpower(LivingEntity entity, ResourceLocation powerId)
Removes a superpower to the entity

superpowerUtil.removeAllSuperpowers(LivingEntity entity)
Removes all superpowers from an entity

Ability Util

getEntries(LivingEntity entity)
Returns all ability entries from the given entity

getEntries(LivingEntity entity, ResourceLocation abilityId)
Returns all ability entries of the given ability type from the entity

getEntry(LivingEntity entity, ResourceLocation powerId, String abilityKey)
Returns a specific ability entry from a specific power

isUnlocked(LivingEntity entity, ResourceLocation powerId, String abilityKey)
Checks if a specific ability entry is unlocked

isEnabled(LivingEntity entity, ResourceLocation powerId, String abilityKey)
Checks if a specific ability entry is enabled

hasPower(LivingEntity entity, ResourceLocation powerId)
Checks if the entity has that power (can be superpower or power of any source)

AnimationUtil

getAnimationTimerAbilityValue(LivingEntity entity, ResourceLocation powerId, String abilityKey, float partialTicks)
Gives you the animation progress of the given ability, a float ranging from 0.0 to 1.0

getAnimationTimerAbilityValue(LivingEntity entity, ResourceLocation powerId, String abilityKey, float partialTicks, float start, float end)
Gives you the animation progress of the given ability, a float ranging from 0.0 to 1.0. BUT you can determines which part of the progress you want to look at. If the animation ability goes up to 30, and you only want to see the progress of between 10 and 20 you can use this function.

getInbetweenProgress(float progress, float startingPoint, float endPoint)
Calculcates the progress of a bigger number, given from two points. If progress is a float that goes up to 30, and you want to see how far the number is from 10-20, you can use the other 2 parameters to determine that.