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
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionaffectMonsterSpawning(boolean affectsMonsterSpawning) Ifinvisible()returns true, this will return theVanishStatewith the desired flag.booleanGets ifaffectsMonsterSpawning()returnsfalse, the vanishedEntitywill not spawn monsters or affect near by monster spawners.createParticles(boolean createParticles) Ifinvisible()returns true, this will return theVanishStatewith the desired flag ofcreatesParticles().createSounds(boolean createSounds) Ifinvisible()returns true, this will return theVanishStatewith the desired flag ofcreatesSounds().booleanGets if theEntitywill produce particles from various actions that occur whileinvisible()istrue.booleanignoreCollisions(boolean ignoresCollisions) Ifinvisible()returns true, this will return theVanishStatewith the desired flag ofignoresCollisions().booleanGets if theEntitywill ignore collisions.booleanGets whether the state is visible.booleanGets if theEntitywill trigger vibrations from various actions while vanished.triggerVibrations(boolean triggerVibrations) Ifinvisible()returns true, this will return theVanishStatewith the desired flag replacingtriggerVibrations().booleanGets if theEntitywill be untargetable by entity ai.untargetable(boolean untargetable) Ifinvisible()returns true, this will return theVanishStatewith the desired flag ofignoresCollisions().unvanish()static VanishStateAVanishStatethat is invisible with the following defaults:invisible()=falseaffectsMonsterSpawning()=trueuntargetable()=falsecreatesSounds()=truecreatesParticles()=truetriggerVibrations()=falsevanish()static VanishStatevanished()Gets a vanished state viavanish()with the following defaults:invisible()=trueaffectsMonsterSpawning()=falseuntargetable()=truecreatesSounds()=falsecreatesParticles()=falsetriggerVibrations()=false
-
Method Details
-
vanished
Gets a vanished state viavanish()with the following defaults:invisible()=trueaffectsMonsterSpawning()=falseuntargetable()=truecreatesSounds()=falsecreatesParticles()=falsetriggerVibrations()=false
- Returns:
- A vanished state with the provided defaults
-
unvanished
AVanishStatethat is invisible with the following defaults:invisible()=falseaffectsMonsterSpawning()=trueuntargetable()=falsecreatesSounds()=truecreatesParticles()=truetriggerVibrations()=false
- 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
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
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
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
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
Ifinvisible()returns true, this will return theVanishStatewith the desired flag ofcreatesParticles().- Parameters:
createParticles- Whether theEntitywill produce particles- Returns:
- The new VanishState
-
triggerVibrations
boolean triggerVibrations()Gets if theEntitywill trigger vibrations from various actions while vanished. These vibrations are generally measured/reacted bySculkSensorsand potentially create particles.- Returns:
- Whether the
Entitywill trigger vibrations while invisible
-
triggerVibrations
Ifinvisible()returns true, this will return theVanishStatewith the desired flag replacingtriggerVibrations().- Parameters:
triggerVibrations- Whether theEntitywill trigger vibrations while invisible- Returns:
- The new VanishState
-