Skip to content
On this page

Effect Commands


Has Effect

  • Method: player.hasEffect(effect)
  • Arguments:
    • { Effect} effect. (Optional: false)
  • Return: boolean
  • Usage:
ts
import { Effect } from '@rpgjs/database'

const bool = player.hasEffect(Effect.CAN_NOT_SKILL)

Get Effects

  • Property: player.effects
  • Type: Array< Effect>
  • Optional: false
  • Usage:

Retrieves a array of effects assigned to the player, state effects and effects of weapons and armors equipped with the player's own weapons.

ts
console.log(player.effects)

Set Effects

  • Property: player.effects
  • Type: Array< Effect>
  • Optional: false
  • Usage:

Assigns effects to the player. If you give a array, it does not change the effects of the player's states and armor/weapons equipped.

ts
import { Effect } from '@rpgjs/database'

player.effects = [Effect.CAN_NOT_SKILL]