Package org.spongepowered.api.effect
Interface VanishState
-
public interface VanishStateRepresents the state of anEntity's vanish state. Accessible throughKeys.VANISH_STATE
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceVanishState.Factory
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description VanishStateaffectMonsterSpawning(boolean affectsMonsterSpawning)Ifinvisible()returns true, this will return theVanishStatewith the desired flag.booleanaffectsMonsterSpawning()Gets ifaffectsMonsterSpawning()returnsfalse, the vanishedEntitywill not spawn monsters or affect near by monster spawners.VanishStatecreateParticles(boolean createParticles)Ifinvisible()returns true, this will return theVanishStatewith the desired flag ofcreatesParticles().VanishStatecreateSounds(boolean createSounds)Ifinvisible()returns true, this will return theVanishStatewith the desired flag ofcreatesSounds().booleancreatesParticles()Gets if theEntitywill produce particles from various actions that occur whileinvisible()istrue.booleancreatesSounds()VanishStateignoreCollisions(boolean ignoresCollisions)Ifinvisible()returns true, this will return theVanishStatewith the desired flag ofignoresCollisions().booleanignoresCollisions()Gets if theEntitywill ignore collisions.booleaninvisible()Gets whether the state is visible.booleanuntargetable()Gets if theEntitywill be untargetable by entity ai.VanishStateuntargetable(boolean untargetable)Ifinvisible()returns true, this will return theVanishStatewith the desired flag ofignoresCollisions().VanishStateunvanish()static VanishStateunvanished()AVanishStatethat is invisible with the following defaults:invisible()=falseaffectsMonsterSpawning()=trueuntargetable()=falsecreatesSounds()=truecreatesParticles()=trueVanishStatevanish()static VanishStatevanished()Gets a vanished state viavanish()with the following defaults:invisible()=trueaffectsMonsterSpawning()=falseuntargetable()=truecreatesSounds()=falsecreatesParticles()=false
-
-
-
Method Detail
-
vanished
static VanishState vanished()
Gets a vanished state viavanish()with the following defaults:invisible()=trueaffectsMonsterSpawning()=falseuntargetable()=truecreatesSounds()=falsecreatesParticles()=false
- Returns:
- A vanished state with the provided defaults
-
unvanished
static VanishState unvanished()
AVanishStatethat is invisible with the following defaults:invisible()=falseaffectsMonsterSpawning()=trueuntargetable()=falsecreatesSounds()=truecreatesParticles()=true
- Returns:
- A visible state with the provided defaults
-
invisible
boolean invisible()
Gets whether the state is visible. If anEntityis visible, then other aspects of this state will be ignored, such asignoresCollisions(),untargetable(), etc.- Returns:
- Whether the
Entityis visible
-
vanish
VanishState vanish()
Gets a vanishedstatewithignoresCollisions()anduntargetable()set totrue. If the state is alreadyinvisible(), then the same state is returned.- Returns:
- The vanished state
-
unvanish
VanishState unvanish()
Gets a visible stateVanishStatewithignoresCollisions()anduntargetable()set tofalse. If the state is alreadyinvisible()beingfalse, then the same state is returned.- Returns:
- The visible state
-
ignoresCollisions
boolean ignoresCollisions()
Gets if theEntitywill 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 theVanishStatewith the desired flag ofignoresCollisions().- Parameters:
ignoresCollisions- Whether collisions will be ignored- Returns:
- The new VanishState, the value changed
-
untargetable
boolean untargetable()
Gets if theEntitywill be untargetable by entity ai. In cases whereinvisible()isfalse, this will returnfalse.- Returns:
- Whether the
Entitywill be untargetable
-
untargetable
VanishState untargetable(boolean untargetable)
Ifinvisible()returns true, this will return theVanishStatewith 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 vanishedEntitywill not spawn monsters or affect near by monster spawners.Note that this flag works in conjunction with
Keys.AFFECTS_SPAWNINGsuch that either one beingfalsewill disable spawning.- Returns:
- Whether the
Entitywill affect monster spawning
-
affectMonsterSpawning
VanishState affectMonsterSpawning(boolean affectsMonsterSpawning)
Ifinvisible()returns true, this will return theVanishStatewith the desired flag.Note that this flag works in conjunction with
Keys.AFFECTS_SPAWNINGsuch that either one being false will disable spawning.- Parameters:
affectsMonsterSpawning- Whether theEntitywill affect monster spawning- Returns:
- The new VanishState
-
createsSounds
boolean createsSounds()
- Returns:
- Whether the
Entitywill produce sounds while invisible
-
createSounds
VanishState createSounds(boolean createSounds)
Ifinvisible()returns true, this will return theVanishStatewith the desired flag ofcreatesSounds().- Parameters:
createSounds- Whether theEntitywill produce sounds- Returns:
- The new VanishState
-
createsParticles
boolean createsParticles()
Gets if theEntitywill produce particles from various actions that occur whileinvisible()istrue.- Returns:
- Whether the
Entitywill produce particles while invisible
-
createParticles
VanishState createParticles(boolean createParticles)
Ifinvisible()returns true, this will return theVanishStatewith the desired flag ofcreatesParticles().- Parameters:
createParticles- Whether theEntitywill produce particles- Returns:
- The new VanishState
-
-