Plugin will work by default with all versions 1.17+ and newer minecraft versions, without requiring me to update it.
Apply the freeze effect overlay to players, making it appear as though they are stuck in powdered snow. All messages and additional settings are configurable; refer to the configuration file below.
Commands:
/freezeeffect [player]/@a - Apply a 1-second freeze effect. - Permission: FreezeEffect.use
/freezeeffect [player]/@a [duration] - Duration can be infinite or a timestamp (e.g., 25t, 20s, 4m, 10d, inf, etc.) - Permission: FreezeEffect.use
//freezeeffect [player]/@a remove - Removes the effect - Permission: FreezeEffect.use
/freezeeffect reload - Reload the configuration - Permissions: FreezeEffect.use AND FreezeEffect.reload
To remove the overlay, use 1t for the [duration]
Config
Code (Text):
reloadConfig: '&aConfig reloaded successfully.'
noPermission: '&4You do not have permission to execute this command.'
offlinePlayer: '&cPlayer {invalid} is currently offline.'
invalidTimestamp: '&cInvalid value: {invalid}. Use the correct format, e.g., 5t, 4s, 20m, 5d, inf.'
confirmation: '&aThe player {player} will have the freeze effect for {timestamp}.'
received: '&aYou have received the freeze effect from {player} for {timestamp}.'
receivedEnabled: true
expired: '&cThe freeze effect has expired.'
expiredEnabled: true
cmdUsage:
- '&aUse: /freezeeffect [player/@a] - Apply a 1-second freeze effect.'
- '&aUse: /freezeeffect [player/@a] [duration] - Duration can be infinite or a timestamp, e.g., 25t, 20s, 4m, 10d, inf, etc'
- '&aUse: /freezeeffect [player/@a] remove - Removes the effect'
#
# Plugin settings
#
# If false, the freeze time will persist once the player logs in again.
# If set to true and later set to false, all the saved remaining time will be deleted.
removeCustomFreezeOnQuit: true
# Giving the freeze effect will normally deal damage to players periodically.
# Turning this setting off will disable that.
# The plugin is designed so that players still take the default amount of damage
# if they are actually inside a powdered snow block.
customFrozenPlayersTakeDamage: false
# Only if the above option is enabled.
# This will do nothing if the player is actually staying in powdered snow or if the above setting is disabled (false).
customFrozenPlayersTakeDamageAmount: 1
# Giving players the freeze effect will slow them down.
# However, we can increase their move speed while the freeze effect is active.
# Making this setting active(true) WILL slow down players when they have this effect.
customFrozenPlayersAreSlowed: false
# This will do nothing if the setting above is active (true).
# Default Minecraft speed is 0.2022 without being slowed.
# Try different values and see which fits your needs best.
customFrozenPlayersMoveSpeed: 0.29
#You may use {name} for both messages
#If the freeze effect is removed by the same player, they will only receive removeCommand message if enabled
sendRemoveCommandMessage: true
removeCommand: '&cThe freeze effect has been removed'
removedEffect: '&cYou have removed the freeze effect for {name}'
#In seconds
customFrozenPlayersTakeDamageDelay: 2
removeEffectOnDeath: false
#
API
Code (Text):
public class FreezeAPI {
// Adds a freeze effect to a player with the specified UUID, duration in ticks, or infinite
public void addPlayerFreezeEffect(UUID uuid, long ticks, boolean inf);
// Removes the freeze effect from a player with the specified UUID and sends an expiration message if specified
public void removePlayerFreezeEffect(UUID uuid, boolean sendExpirationMesssage);
// Retrieves the remaining time (in ticks) for the freeze effect on a player with the specified UUID
public long getRemainFreezeEffect(UUID uuid);
// Clears the cache of remaining time for all offline frozen players
public void clearRemainTimeCache();
}
API Event CustomFreezeEffectAddEvent
Code (Text):
public class CustomFreezeEffectAddEvent extends Event implements Cancellable {
public long getTicks()
public void setTicks(long ticks)
public AddEffectReason getReason()
public Player getPlayer()
public boolean modifyMoveSpeed()
public void setModifyMoveSpeed(boolean modifyMoveSpeed)
public float getModifiedMoveSpeed()
public void setModifiedMoveSpeed(float modifiedMoveSpeedIfEnabled)
public boolean isInfinite()
public void setInfinite()
@Override
public boolean isCancelled()
@Override
public void setCancelled(boolean cancelled)
}
API Event CustomFreezeEffectRemoveEvent
Code (Text):
public long getTicks()
public boolean isInfinite()
public boolean isModifyMoveSpeed()
public void setModifyMoveSpeed(boolean modifyMoveSpeed)
public float getModifiedMoveSpeedIfEnabled()
public void setModifiedMoveSpeedIfEnabled(float modifiedMoveSpeedIfEnabled)
public UUID getPlayer()
public RemoveEffectReason getReason()
@Override
public boolean isCancelled()
@Override
public void setCancelled(boolean isCancelled)
Retrieving the API - Make sure you have this plugin as a dependency
Code (Text):
FE plugin = (FE) Bukkit.getPluginManager().getPlugin("FreezeEffect");
If you encounter any bugs or have suggestions you want implemented, contact me on Discord: balustrada
I only log into my Spigot account once every couple of months, so you'll receive a much faster response there.