Class Magic
- java.lang.Object
-
- net.eternalclient.api.wrappers.magic.Magic
-
public class Magic extends java.lang.ObjectA class that provides methods for magic-related actions.
-
-
Constructor Summary
Constructors Constructor Description Magic()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancanCast(Spell spell)Determines if a spell can be cast.static booleancastSpell(Spell spell)Executes the given spell by creating a CastSpellEvent and returns a boolean indicating whether the spell was successfully cast.static booleancastSpell(Spell spell, java.lang.String action)Casts the specified spell with the given action.static booleancastSpellOn(Spell spell, Entity entity)Casts the specified spell on the given entity.static booleancastSpellOn(Spell spell, Item item)Casts a specified spell on a given item.static booleanforceCastSpell(Spell spell)Forces the casting of a specified spell, skipping the runes check.static booleanforceCastSpell(Spell spell, java.lang.String action)Forces the casting of a specified spell with the given action, skipping the runes check.static SpellgetSelectedSpell()Returns the selected spell based on the corresponding spell interface.static java.lang.StringgetSelectedSpellName()Retrieves the name of the selected spell.static SpellBookgetSpellBook()Retrieves the active spell book.static SpellgetSpellFromName(java.lang.String spellName)Retrieves a spell based on its name.static intgetWidgetOffset()static booleanisAutoCasting()Returns whether the player is currently auto-casting a spell.static booleanisDefensiveAutoCasting()Checks if defensive auto-casting mode is enabled.static booleanisSpellSelected()Checks if a spell is currently selected by the player.static voidsetWidgetOffset(int widgetOffset)
-
-
-
Method Detail
-
getWidgetOffset
public static int getWidgetOffset()
-
setWidgetOffset
public static void setWidgetOffset(int widgetOffset)
-
isSpellSelected
public static boolean isSpellSelected()
Checks if a spell is currently selected by the player.- Returns:
- true if a spell is selected, false otherwise.
-
getSelectedSpellName
public static java.lang.String getSelectedSpellName()
Retrieves the name of the selected spell.- Returns:
- the name of the selected spell, or an empty string if the name is null
-
getSelectedSpell
public static Spell getSelectedSpell()
Returns the selected spell based on the corresponding spell interface.- Returns:
- the selected spell, or null if no spell is selected
-
canCast
public static boolean canCast(Spell spell)
Determines if a spell can be cast.- Parameters:
spell- the spell to check- Returns:
- true if the spell can be cast, false otherwise
-
castSpell
public static boolean castSpell(Spell spell)
Executes the given spell by creating a CastSpellEvent and returns a boolean indicating whether the spell was successfully cast.- Parameters:
spell- the spell to be cast- Returns:
- true if the spell was cast successfully, false otherwise
-
forceCastSpell
public static boolean forceCastSpell(Spell spell)
Forces the casting of a specified spell, skipping the runes check.- Parameters:
spell- the spell to be cast- Returns:
- true if the spell was successfully cast; false otherwise
-
castSpell
public static boolean castSpell(Spell spell, java.lang.String action)
Casts the specified spell with the given action.- Parameters:
spell- the spell to be castedaction- the action to be performed- Returns:
trueif the spell was successfully casted,falseotherwise
-
forceCastSpell
public static boolean forceCastSpell(Spell spell, java.lang.String action)
Forces the casting of a specified spell with the given action, skipping the runes check.- Parameters:
spell- the spell to be castedaction- the action to be performed- Returns:
trueif the spell was successfully casted,falseotherwise
-
castSpellOn
public static boolean castSpellOn(Spell spell, Entity entity)
Casts the specified spell on the given entity.- Parameters:
spell- the spell to be castedentity- the entity targeted by the spell- Returns:
trueif the spell was successfully casted,falseotherwise
-
castSpellOn
public static boolean castSpellOn(Spell spell, Item item)
Casts a specified spell on a given item.- Parameters:
spell- the spell to be castitem- the item to cast the spell on- Returns:
- true if the spell was successfully cast on the item, false otherwise
-
isAutoCasting
public static boolean isAutoCasting()
Returns whether the player is currently auto-casting a spell.- Returns:
- true if the player is auto-casting, false otherwise.
-
isDefensiveAutoCasting
public static boolean isDefensiveAutoCasting()
Checks if defensive auto-casting mode is enabled.- Returns:
trueif defensive auto-casting mode is enabled,falseotherwise.
-
getSpellFromName
public static Spell getSpellFromName(java.lang.String spellName)
Retrieves a spell based on its name.- Parameters:
spellName- the name of the spell to retrieve- Returns:
- the spell object corresponding to the given name, or null if not found
-
getSpellBook
public static SpellBook getSpellBook()
Retrieves the active spell book.- Returns:
- the active spell book, or null if not found
-
-