Package org.spongepowered.api.effect
Interface VanishState
-
public interface VanishState
Represents the state of anEntity
's vanish state. Accessible throughKeys.VANISH_STATE
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
VanishState.Factory
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description VanishState
affectMonsterSpawning(boolean affectsMonsterSpawning)
Ifinvisible()
returns true, this will return theVanishState
with the desired flag.boolean
affectsMonsterSpawning()
Gets ifaffectsMonsterSpawning()
returnsfalse
, the vanishedEntity
will not spawn monsters or affect near by monster spawners.VanishState
createParticles(boolean createParticles)
Ifinvisible()
returns true, this will return theVanishState
with the desired flag ofcreatesParticles()
.VanishState
createSounds(boolean createSounds)
Ifinvisible()
returns true, this will return theVanishState
with the desired flag ofcreatesSounds()
.boolean
createsParticles()
Gets if theEntity
will produce particles from various actions that occur whileinvisible()
istrue
.boolean
createsSounds()
VanishState
ignoreCollisions(boolean ignoresCollisions)
Ifinvisible()
returns true, this will return theVanishState
with the desired flag ofignoresCollisions()
.boolean
ignoresCollisions()
Gets if theEntity
will ignore collisions.boolean
invisible()
Gets whether the state is visible.boolean
untargetable()
Gets if theEntity
will be untargetable by entity ai.VanishState
untargetable(boolean untargetable)
Ifinvisible()
returns true, this will return theVanishState
with the desired flag ofignoresCollisions()
.VanishState
unvanish()
static VanishState
unvanished()
AVanishState
that is invisible with the following defaults:invisible()
=false
affectsMonsterSpawning()
=true
untargetable()
=false
createsSounds()
=true
createsParticles()
=true
VanishState
vanish()
static VanishState
vanished()
Gets a vanished state viavanish()
with the following defaults:invisible()
=true
affectsMonsterSpawning()
=false
untargetable()
=true
createsSounds()
=false
createsParticles()
=false
-
-
-
Method Detail
-
vanished
static VanishState vanished()
Gets a vanished state viavanish()
with the following defaults:invisible()
=true
affectsMonsterSpawning()
=false
untargetable()
=true
createsSounds()
=false
createsParticles()
=false
- Returns:
- A vanished state with the provided defaults
-
unvanished
static VanishState unvanished()
AVanishState
that is invisible with the following defaults:invisible()
=false
affectsMonsterSpawning()
=true
untargetable()
=false
createsSounds()
=true
createsParticles()
=true
- 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
VanishState ignoreCollisions(boolean ignoresCollisions)
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
VanishState untargetable(boolean 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
VanishState affectMonsterSpawning(boolean affectsMonsterSpawning)
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
VanishState createSounds(boolean 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
VanishState createParticles(boolean createParticles)
Ifinvisible()
returns true, this will return theVanishState
with the desired flag ofcreatesParticles()
.- Parameters:
createParticles
- Whether theEntity
will produce particles- Returns:
- The new VanishState
-
-