Package org.spongepowered.api.effect
Interface Viewer
- All Known Subinterfaces:
- ClientPlayer,- ClientWorld,- ForwardingViewer,- LocalPlayer,- Player,- RemotePlayer,- ServerPlayer,- ServerWorld,- World<W,- L> 
A Viewer is something that sees effects.
 E.g. the Viewer class contains methods for spawning particles and playing
 sound effects.
- 
Method SummaryModifier and TypeMethodDescriptionvoidplayMusicDisc(int x, int y, int z, MusicDisc musicDisc) Plays the givenMusicDiscat the given position.default voidplayMusicDisc(Vector3i position, MusicDisc musicDisc) Plays the givenMusicDiscat the given position.default voidPlays the givenSoundat the given position.voidresetBlockChange(int x, int y, int z) Resets the client's view of the provided position to what actually exists in theWorld.default voidresetBlockChange(Vector3i position) Resets the client's view of the provided position to what actually exists in theWorld.voidresetBlockProgress(int x, int y, int z) Resets the client's view of the provided position to actual breaking progress.default voidresetBlockProgress(Vector3i position) Resets the client's view of the provided position to actual breaking progress.voidsendBlockChange(int x, int y, int z, BlockState state) Sends a client-only block change.default voidsendBlockChange(Vector3i position, BlockState state) Sends a client-only block change.voidsendBlockProgress(int x, int y, int z, double progress) Sends a client-only block breaking progress.default voidsendBlockProgress(Vector3i position, double progress) Sends a client-only block breaking progress.voidsendWorldType(WorldType worldType) Sends the effect of being in a particular world environment, such as the Nether, as an effect to the viewer.voidspawnParticles(ParticleEffect particleEffect, double x, double y, double z) Spawn the givenParticleEffectat the given position.default voidspawnParticles(ParticleEffect particleEffect, Vector3d position) Spawn the givenParticleEffectat the given position.voidstopMusicDisc(int x, int y, int z) Stops theMusicDiscthat is playing at the given position.default voidstopMusicDisc(Vector3i position) Stops theMusicDiscthat is playing at the given position.Methods inherited from interface net.kyori.adventure.audience.AudienceclearResourcePacks, clearTitle, deleteMessage, deleteMessage, filterAudience, forEachAudience, hideBossBar, openBook, openBook, playSound, playSound, playSound, removeResourcePacks, removeResourcePacks, removeResourcePacks, removeResourcePacks, removeResourcePacks, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, sendResourcePacks, sendResourcePacks, sendResourcePacks, sendTitlePart, showBossBar, showTitle, stopSound, stopSoundMethods inherited from interface net.kyori.adventure.pointer.Pointeredget, getOrDefault, getOrDefaultFrom, pointers
- 
Method Details- 
sendWorldTypeSends the effect of being in a particular world environment, such as the Nether, as an effect to the viewer.For example, specifying WorldTypes.THE_NETHERwill create an empty skybox and hazy fog on the vanilla minecraft client- Parameters:
- worldType- The world type
 
- 
spawnParticlesSpawn the givenParticleEffectat the given position.- Parameters:
- particleEffect- The particle effect to spawn
- position- The position
 
- 
spawnParticlesSpawn the givenParticleEffectat the given position.- Parameters:
- particleEffect- The particle effect to spawn
- x- The x position
- y- The y position
- z- The z position
 
- 
playSoundPlays the givenSoundat the given position.- Parameters:
- sound- The sound
- position- The position
 
- 
playMusicDiscPlays the givenMusicDiscat the given position. The benefit of playingMusicDiscinstead of aSoundTypeallows you to stop them through thestopMusicDisc(Vector3i). Playing a newMusicDiscat the same position will cancel the currently playing one.- Parameters:
- position- The position
- musicDisc- The music disc
 
- 
playMusicDiscPlays the givenMusicDiscat the given position. The benefit of playingMusicDiscinstead of aSoundTypeallows you to stop them through thestopMusicDisc(Vector3i). Playing a newMusicDiscat the same position will cancel the currently playing one.- Parameters:
- x- The x position
- y- The y position
- z- The z position
- musicDisc- The music disc
 
- 
stopMusicDiscStops theMusicDiscthat is playing at the given position.- Parameters:
- position- The position
 
- 
stopMusicDiscvoid stopMusicDisc(int x, int y, int z) Stops theMusicDiscthat is playing at the given position.- Parameters:
- x- The x position
- y- The y position
- z- The z position
 
- 
sendBlockChangeSends a client-only block change.This will not change the Worldin any way.- Parameters:
- position- The position
- state- The block state
 
- 
sendBlockChangeSends a client-only block change.This will not change the Worldin any way.- Parameters:
- x- The x position
- y- The y position
- z- The z position
- state- The block state
 
- 
resetBlockChangeResets the client's view of the provided position to what actually exists in theWorld.This is useful for resetting what the client sees after sending a block change.- Parameters:
- position- The position
 
- 
resetBlockChangevoid resetBlockChange(int x, int y, int z) Resets the client's view of the provided position to what actually exists in theWorld.This is useful for resetting what the client sees after sending a block change.- Parameters:
- x- The x position
- y- The y position
- z- The z position
 
- 
sendBlockProgressSends a client-only block breaking progress.- Parameters:
- position- The position
- progress- The breaking progress from 0 to 1
 
- 
sendBlockProgressvoid sendBlockProgress(int x, int y, int z, double progress) Sends a client-only block breaking progress.- Parameters:
- x- The x position
- y- The y position
- z- The z position
- progress- The breaking progress from 0 to 1
 
- 
resetBlockProgressResets the client's view of the provided position to actual breaking progress.This is useful for resetting what the client sees after sending a block progress.- Parameters:
- position- The position
 
- 
resetBlockProgressvoid resetBlockProgress(int x, int y, int z) Resets the client's view of the provided position to actual breaking progress.This is useful for resetting what the client sees after sending a block progress.- Parameters:
- x- The x position
- y- The y position
- z- The z position
 
 
-