# Class StealEatBerryAttr

Attribute used for moves that steal a random berry from the target. The user then eats the stolen berry. Used for Pluck & Bug Bite.

#### Hierarchy (view full)

- EatBerryAttr
  - StealEatBerryAttr

- Defined in src/data/move.ts:1851

#####
Index

### Constructors

constructor

### Properties

chosenBerry
firstHitOnly
selfTarget
trigger

### Methods

apply
canApply
getCondition
getFailedText
getTargetBenefitScore
getTargetHeldBerries
getUserBenefitScore

## Constructors

### constructor

- new StealEatBerryAttr(): StealEatBerryAttr

- #### Returns StealEatBerryAttr

  Overrides EatBerryAttr.constructor

  - Defined in src/data/move.ts:1852

## Properties

### `Protected` chosenBerry

chosenBerry: BerryModifier

Inherited from EatBerryAttr.chosenBerry

- Defined in src/data/move.ts:1796

### firstHitOnly

firstHitOnly: boolean

Should this effect only apply on the first hit?

Inherited from EatBerryAttr.firstHitOnly

- Defined in src/data/move.ts:795

### selfTarget

selfTarget: boolean

Should this `Move` target the user?

Inherited from EatBerryAttr.selfTarget

- Defined in src/data/move.ts:718

### trigger

trigger: MoveEffectTrigger

Defines when this effect should trigger in the move's effect order

#### See

MoveEffectPhase.start

Inherited from EatBerryAttr.trigger

- Defined in src/data/move.ts:793

## Methods

### apply

- apply(user, target, move, args): boolean

- User steals a random berry from the target and then eats it.

  #### Parameters

  - user: default

    Pokemon that used the move and will eat the stolen berry

  - target: default

    Pokemon that will have its berry stolen

  - move: default

    Move being used

  - args: any[]

    Unused

  #### Returns boolean

  true if the function succeeds

  Overrides EatBerryAttr.apply

  - Defined in src/data/move.ts:1863

### canApply

- canApply(user, target, move, args): boolean

- Determines whether the `Move`'s effects are valid to `apply`

  #### Parameters

  - user: default

    `Pokemon` using the move

  - target: default

    `Pokemon` target of the move

  - move: default

    `Move` with this attribute

  - args: any[]

    Set of unique arguments needed by this attribute

  #### Returns boolean

  true if basic application of the ability attribute should be possible

  Inherited from EatBerryAttr.canApply

  - Defined in src/data/move.ts:812

### getCondition

- getCondition(): MoveCondition | MoveConditionFunc

- #### Returns MoveCondition | MoveConditionFunc

  the `MoveCondition` or MoveConditionFunc for this `Move`

  Inherited from EatBerryAttr.getCondition

  - Defined in src/data/move.ts:742

### getFailedText

- getFailedText(user, target, move, cancelled): string

- #### Parameters

  - user: default

    `Pokemon` using the move

  - target: default

    `Pokemon` target of the move

  - move: default

    `Move` with this attribute

  - cancelled: BooleanHolder

    `Utils.BooleanHolder` which stores if the move should fail

  #### Returns string

  the string representing failure of this `Move`

  Inherited from EatBerryAttr.getFailedText

  - Defined in src/data/move.ts:754

### getTargetBenefitScore

- getTargetBenefitScore(user, target, move): number

- Used by the Enemy AI to rank an attack based on a given target

  #### Parameters

  - user: default
  - target: default
  - move: default

  #### Returns number

  #### See

  `EnemyPokemon.getNextMove`

  Inherited from EatBerryAttr.getTargetBenefitScore

  - Defined in src/data/move.ts:772

### getTargetHeldBerries

- getTargetHeldBerries(target): BerryModifier []

- #### Parameters

  - target: default

  #### Returns BerryModifier []

  Inherited from EatBerryAttr.getTargetHeldBerries

  - Defined in src/data/move.ts:1841

### getUserBenefitScore

- getUserBenefitScore(user, target, move): number

- Used by the Enemy AI to rank an attack based on a given user

  #### Parameters

  - user: default
  - target: default
  - move: default

  #### Returns number

  #### See

  `EnemyPokemon.getNextMove`

  Inherited from EatBerryAttr.getUserBenefitScore

  - Defined in src/data/move.ts:763