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 Summary
Modifier and TypeMethodDescriptionvoid
playMusicDisc
(int x, int y, int z, MusicDisc musicDisc) Plays the givenMusicDisc
at the given position.default void
playMusicDisc
(Vector3i position, MusicDisc musicDisc) Plays the givenMusicDisc
at the given position.default void
Plays the givenSound
at the given position.void
resetBlockChange
(int x, int y, int z) Resets the client's view of the provided position to what actually exists in theWorld
.default void
resetBlockChange
(Vector3i position) Resets the client's view of the provided position to what actually exists in theWorld
.void
resetBlockProgress
(int x, int y, int z) Resets the client's view of the provided position to actual breaking progress.default void
resetBlockProgress
(Vector3i position) Resets the client's view of the provided position to actual breaking progress.void
sendBlockChange
(int x, int y, int z, BlockState state) Sends a client-only block change.default void
sendBlockChange
(Vector3i position, BlockState state) Sends a client-only block change.void
sendBlockProgress
(int x, int y, int z, double progress) Sends a client-only block breaking progress.default void
sendBlockProgress
(Vector3i position, double progress) Sends a client-only block breaking progress.void
sendWorldType
(WorldType worldType) Sends the effect of being in a particular world environment, such as the Nether, as an effect to the viewer.void
spawnParticles
(ParticleEffect particleEffect, double x, double y, double z) Spawn the givenParticleEffect
at the given position.default void
spawnParticles
(ParticleEffect particleEffect, Vector3d position) Spawn the givenParticleEffect
at the given position.void
stopMusicDisc
(int x, int y, int z) Stops theMusicDisc
that is playing at the given position.default void
stopMusicDisc
(Vector3i position) Stops theMusicDisc
that is playing at the given position.Methods inherited from interface net.kyori.adventure.audience.Audience
clearResourcePacks, 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, stopSound
Methods inherited from interface net.kyori.adventure.pointer.Pointered
get, getOrDefault, getOrDefaultFrom, pointers
-
Method Details
-
sendWorldType
Sends the effect of being in a particular world environment, such as the Nether, as an effect to the viewer.For example, specifying
WorldTypes.THE_NETHER
will create an empty skybox and hazy fog on the vanilla minecraft client- Parameters:
worldType
- The world type
-
spawnParticles
Spawn the givenParticleEffect
at the given position.- Parameters:
particleEffect
- The particle effect to spawnposition
- The position
-
spawnParticles
Spawn the givenParticleEffect
at the given position.- Parameters:
particleEffect
- The particle effect to spawnx
- The x positiony
- The y positionz
- The z position
-
playSound
Plays the givenSound
at the given position.- Parameters:
sound
- The soundposition
- The position
-
playMusicDisc
Plays the givenMusicDisc
at the given position. The benefit of playingMusicDisc
instead of aSoundType
allows you to stop them through thestopMusicDisc(Vector3i)
. Playing a newMusicDisc
at the same position will cancel the currently playing one.- Parameters:
position
- The positionmusicDisc
- The music disc
-
playMusicDisc
Plays the givenMusicDisc
at the given position. The benefit of playingMusicDisc
instead of aSoundType
allows you to stop them through thestopMusicDisc(Vector3i)
. Playing a newMusicDisc
at the same position will cancel the currently playing one.- Parameters:
x
- The x positiony
- The y positionz
- The z positionmusicDisc
- The music disc
-
stopMusicDisc
Stops theMusicDisc
that is playing at the given position.- Parameters:
position
- The position
-
stopMusicDisc
void stopMusicDisc(int x, int y, int z) Stops theMusicDisc
that is playing at the given position.- Parameters:
x
- The x positiony
- The y positionz
- The z position
-
sendBlockChange
Sends a client-only block change.This will not change the
World
in any way.- Parameters:
position
- The positionstate
- The block state
-
sendBlockChange
Sends a client-only block change.This will not change the
World
in any way.- Parameters:
x
- The x positiony
- The y positionz
- The z positionstate
- The block state
-
resetBlockChange
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:
position
- The position
-
resetBlockChange
void 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 positiony
- The y positionz
- The z position
-
sendBlockProgress
Sends a client-only block breaking progress.- Parameters:
position
- The positionprogress
- The breaking progress from 0 to 1
-
sendBlockProgress
void sendBlockProgress(int x, int y, int z, double progress) Sends a client-only block breaking progress.- Parameters:
x
- The x positiony
- The y positionz
- The z positionprogress
- The breaking progress from 0 to 1
-
resetBlockProgress
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:
position
- The position
-
resetBlockProgress
void 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 positiony
- The y positionz
- The z position
-