Package org.spongepowered.api.effect
Interface VanishState
public interface VanishState
Represents the state of an
Entity
's vanish state.
Accessible through Keys.VANISH_STATE
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionaffectMonsterSpawning
(boolean affectsMonsterSpawning) Ifinvisible()
returns true, this will return theVanishState
with the desired flag.boolean
Gets ifaffectsMonsterSpawning()
returnsfalse
, the vanishedEntity
will not spawn monsters or affect near by monster spawners.createParticles
(boolean createParticles) Ifinvisible()
returns true, this will return theVanishState
with the desired flag ofcreatesParticles()
.createSounds
(boolean createSounds) Ifinvisible()
returns true, this will return theVanishState
with the desired flag ofcreatesSounds()
.boolean
Gets if theEntity
will produce particles from various actions that occur whileinvisible()
istrue
.boolean
ignoreCollisions
(boolean ignoresCollisions) Ifinvisible()
returns true, this will return theVanishState
with the desired flag ofignoresCollisions()
.boolean
Gets if theEntity
will ignore collisions.boolean
Gets whether the state is visible.boolean
Gets if theEntity
will trigger vibrations from various actions while vanished.triggerVibrations
(boolean triggerVibrations) Ifinvisible()
returns true, this will return theVanishState
with the desired flag replacingtriggerVibrations()
.boolean
Gets if theEntity
will be untargetable by entity ai.untargetable
(boolean untargetable) Ifinvisible()
returns true, this will return theVanishState
with the desired flag ofignoresCollisions()
.unvanish()
static VanishState
AVanishState
that is invisible with the following defaults:invisible()
=false
affectsMonsterSpawning()
=true
untargetable()
=false
createsSounds()
=true
createsParticles()
=true
triggerVibrations()
=false
vanish()
static VanishState
vanished()
Gets a vanished state viavanish()
with the following defaults:invisible()
=true
affectsMonsterSpawning()
=false
untargetable()
=true
createsSounds()
=false
createsParticles()
=false
triggerVibrations()
=false
-
Method Details
-
vanished
Gets a vanished state viavanish()
with the following defaults:invisible()
=true
affectsMonsterSpawning()
=false
untargetable()
=true
createsSounds()
=false
createsParticles()
=false
triggerVibrations()
=false
- Returns:
- A vanished state with the provided defaults
-
unvanished
AVanishState
that is invisible with the following defaults:invisible()
=false
affectsMonsterSpawning()
=true
untargetable()
=false
createsSounds()
=true
createsParticles()
=true
triggerVibrations()
=false
- Returns:
- A visible state with the provided defaults
-
invisible
boolean invisible()Gets whether the state is visible. If anEntity
is visible, then other aspects of this state will be ignored, such asignoresCollisions()
,untargetable()
, etc.- Returns:
- Whether the
Entity
is visible
-
vanish
VanishState vanish()Gets a vanishedstate
withignoresCollisions()
anduntargetable()
set totrue
. If the state is alreadyinvisible()
, then the same state is returned.- Returns:
- The vanished state
-
unvanish
VanishState unvanish()Gets a visible stateVanishState
withignoresCollisions()
anduntargetable()
set tofalse
. If the state is alreadyinvisible()
beingfalse
, then the same state is returned.- Returns:
- The visible state
-
ignoresCollisions
boolean ignoresCollisions()Gets if theEntity
will ignore collisions. In cases whereinvisible()
isfalse
, this will returnfalse
.- Returns:
- Whether collisions will be ignored
-
ignoreCollisions
Ifinvisible()
returns true, this will return theVanishState
with the desired flag ofignoresCollisions()
.- Parameters:
ignoresCollisions
- Whether collisions will be ignored- Returns:
- The new VanishState, the value changed
-
untargetable
boolean untargetable()Gets if theEntity
will be untargetable by entity ai. In cases whereinvisible()
isfalse
, this will returnfalse
.- Returns:
- Whether the
Entity
will be untargetable
-
untargetable
Ifinvisible()
returns true, this will return theVanishState
with the desired flag ofignoresCollisions()
.- Parameters:
untargetable
- Whether the entity can be targeted by AI- Returns:
- The new VanishState, the value changed
-
affectsMonsterSpawning
boolean affectsMonsterSpawning()Gets ifaffectsMonsterSpawning()
returnsfalse
, the vanishedEntity
will not spawn monsters or affect near by monster spawners.Note that this flag works in conjunction with
Keys.AFFECTS_SPAWNING
such that either one beingfalse
will disable spawning.- Returns:
- Whether the
Entity
will affect monster spawning
-
affectMonsterSpawning
Ifinvisible()
returns true, this will return theVanishState
with the desired flag.Note that this flag works in conjunction with
Keys.AFFECTS_SPAWNING
such that either one being false will disable spawning.- Parameters:
affectsMonsterSpawning
- Whether theEntity
will affect monster spawning- Returns:
- The new VanishState
-
createsSounds
boolean createsSounds()- Returns:
- Whether the
Entity
will produce sounds while invisible
-
createSounds
Ifinvisible()
returns true, this will return theVanishState
with the desired flag ofcreatesSounds()
.- Parameters:
createSounds
- Whether theEntity
will produce sounds- Returns:
- The new VanishState
-
createsParticles
boolean createsParticles()Gets if theEntity
will produce particles from various actions that occur whileinvisible()
istrue
.- Returns:
- Whether the
Entity
will produce particles while invisible
-
createParticles
Ifinvisible()
returns true, this will return theVanishState
with the desired flag ofcreatesParticles()
.- Parameters:
createParticles
- Whether theEntity
will produce particles- Returns:
- The new VanishState
-
triggerVibrations
boolean triggerVibrations()Gets if theEntity
will trigger vibrations from various actions while vanished. These vibrations are generally measured/reacted bySculkSensors
and potentially create particles.- Returns:
- Whether the
Entity
will trigger vibrations while invisible
-
triggerVibrations
Ifinvisible()
returns true, this will return theVanishState
with the desired flag replacingtriggerVibrations()
.- Parameters:
triggerVibrations
- Whether theEntity
will trigger vibrations while invisible- Returns:
- The new VanishState
-