[Throwable Creeper Eggs] Spawn egg duplication issue
GuilleX7 opened this issue ยท 1 comments
It seems ExplodeAny causes some sort of duplication issue when a creeper egg is thrown, see recording.
ExplodeAny configuration:
# Whether to use a database or not. While it's not necessary at all, a database will keep
# track of every block's durability, so durability is not reset after a server restart.
# Warning: the file that contains the database can become huge, so consider cleaning it up
# (this is, removing it) after X server restarts (let's be serious, nobody's gonna care if
# a block he/she damaged three days ago has now its durability fully restored).
UseBlockDatabase: false
# (Note: not used at all if useBlockDatabase is disabled)
# This will perform a database cleanup every time the plugin is reloaded.
# This can help reducing the database size, but may also load the chunks where the blocks were
# located.
CheckBlockDatabaseAtStartup: false
# Maximum and initial durability of every block handled by ExplodeAny.
# [Minimum] is 1.0.
# [Default] is 100.0.
BlockDurability: 100.0
# Metrics allow us to obtain information about the number of servers that use ExplodeAny,
# as well as some of their characteristics, including operating system and Java Version, etc.
# All this data is completely anonymous, and sending metrics does not affect performance. We
# use bstats (https://bstats.org/) to gather all this data.
EnableMetrics: false
# Named groups of materials and/or entitys. You can create groups with a mix of materials
# and entities. When you use the group in a certain section, the plugin will choose only
# the values that make sense for that section. If no value in the group makes sense for the
# section, then it will be considered an invalid group. You can use the name you like for the
# groups, but if group's name coincides with a valid material or entity's name, then the valid
# material or entity will be selected as the target, and not the group.
#
# When a single entity/material appears more than once in the same section, the following rules
# will be used to merge them, depending on the section:
#
# EXPLODING ENTITIES:
# 1. If an entity appears in two or more groups, then the material configurations
# will try to merge without overwriting each other. If a material configuration
# for an entity appears in both groups, then the material configuration of the
# group that appears first in the configuration is applied.
# 2. If an entity appears in two or more groups but also as an individual item,
# then rule 1 applies, and after that, the individual configuration will be merged,
# overwriting the previous rules if necessary (has greater priority than groups).
#
# MATERIAL CONFIGURATIONS:
# 1. If a material configuration appears in two or more groups, then only the material
# configuration of the group that appears first in the configuration will be applied.
# 2. If a material configuration appears in two or more groups but also as an individual
# item, then the individual configuration will be applied.
Groups:
unbreakableBlocks:
- OBSIDIAN
- CRYING_OBSIDIAN
- ENCHANTING_TABLE
- ANVIL
- DAMAGED_ANVIL
- CHIPPED_ANVIL
- REINFORCED_DEEPSLATE
- NETHERITE_BLOCK
- ENDER_CHEST
dangerousEntity:
- PRIMED_TNT
- CREEPER
- CHARGED_CREEPER
# This sections allows to customize the behaviour of Vanilla entities explosions
# Allowed entity values are:
# WITHER, ENDER_CRYSTAL, PRIMED_TNT, MINECART_TNT, CREEPER, CHARGED_CREEPER,
# FIREBALL, DRAGON_FIREBALL, SMALL_FIREBALL, WITHER_SKULL, CHARGED_WITHER_SKULL,
# BED, RESPAWN_ANCHOR
# Note that every property that appears here can be used in any other entity section, like
# CannonProjectile, MagicEntity or CustomEntity.
VanillaEntity:
# Groups can also be used here (like this one).
dangerousEntity:
# This section allows to configure some properties of the exploding entity itself.
# It is not mandatory.
Properties:
# Setting this to anything different than 0.0 will override the original explosion radius.
# [Minimum] [default] is 0.0, which means keeping the original explosion radius.
ExplosionRadius: 0.0
# Multiplicative factor applied to the explosion radius.
# [Minimum] is 0.0, which means nullifying the explosion.
# [Default] is 1.0, which means keeping the original explosion radius.
# A value greater than 1.0 means magnifying the explosion radius.
ExplosionFactor: 1.0
# If the original explosion is not replaced, the above properties (ExplosionRadius, ExplosionFactor)
# will only affect the radius that ExplodeAny will use to calculate the damage to blocks. The original
# explosion will keep its original radius.
#
# If replaced, the new explosion will have the specified explosion radius, but some properties
# of the original explosion might get lost. For example, if the original explosion was to set
# blocks on fire, the replacement will not keep this behaviour. Cannons projectiles will also
# lose their special properties, such as clustering, etc.
#
# [Default] is false.
ReplaceOriginalExplosion: false
# Multiplicative factor applied to the explosion radius when it takes place underwater.
# [Minimum] is 0.0, which means it will disabled
# [Default] is 0.5, which reduces the explosion radius to half its original value.
# A value of 1.0 means that water doesn't affect explosion radius
# A value greater than 1.0 means underwater explosion radius is magnified.
UnderwaterExplosionFactor: 2.0
# If the explosion takes place underwater, set this true to create a custom explosion that can
# break unmanaged Vanilla blocks underwater (like sand, stone or dirt). Blocks managed by ExplodeAny
# will keep their behaviour!
# [Default] is false.
ExplosionDamageBlocksUnderwater: true
# If ExplosionDamageBlocksUnderwater is set true, then this property determines whether
# the original explosion is replaced with the one that ExplodeAny will spawn to break blocks
# underwater.
#
# If replaced, some properties of the original explosion might get lost. For example, if the
# original explosion was to set blocks on fire, the replacement will not keep this behaviour.
# Cannons projectiles will also lose their special properties, such as clustering, etc.
#
# Not replacing it means that the ExplodeAny explosion will spawn together with the original one,
# which is not bad at all but might be undesired for some people (double entity damage? laggier?).
# I suggest to play with this parameter and decide!
#
# [Default] is true.
ReplaceOriginalExplosionWhenUnderwater: true
# The explosion will remove the waterlogged state from nearby blocks before the explosion,
# thus causing damage to blocks that would normally not break, like waterlogged stairs, etc.
# [Default] is false.
ExplosionRemoveWaterloggedStateFromNearbyBlocks: true
# Specifies when ExplosionRemoveWaterloggedStateFromNearbyBlocks is applied. Surface and
# underwater refer to the explosion's location.
ExplosionRemoveWaterloggedStateFromNearbyBlocksOnSurface: true
ExplosionRemoveWaterloggedStateFromNearbyBlocksUnderwater: true
# The explosion will remove nearby waterlogged blocks before the explosion. If this and
# ExplosionRemoveWaterloggedStateFromNearbyBlocks are both set to true, then this takes
# precedence.
ExplosionRemoveNearbyWaterloggedBlocks: false
# Specifies when ExplosionRemoveNearbyWaterloggedBlocks is applied. Surface and underwater
# refer to the explosion's location.
ExplosionRemoveNearbyWaterloggedBlocksOnSurface: true
ExplosionRemoveNearbyWaterloggedBlocksUnderwater: true
# The explosion will remove nearby liquids before the explosion, thus allowing to break
# through liquids.
# [Default] is false.
ExplosionRemoveNearbyLiquids: true
# Specifies when ExplosionRemoveNearbyLiquids is applied. Surface and underwater refer to
# the explosion's location.
ExplosionRemoveNearbyLiquidsOnSurface: true
ExplosionRemoveNearbyLiquidsUnderwater: true
# The explosion will pack the dropped items into a single entity, which will be spawned
# at the explosion's location. This can help reducing lag on client side when the explosion
# causes a lot of items to be spawned (in general, when explosion radius > 10 and many items
# are dropped). If set to false, then items will drop naturally (like in Vanilla).
# [Default] is false.
PackDroppedItems: false
# This section allows to specify the particles that will spawn when the entity explodes.
Particles:
# Name of the particles to be spawned. Valid values are listed in
# https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Particle.html
Name: NONE
# Size of the cube that will contain the particles
DeltaX: 2.0
DeltaY: 2.0
DeltaZ: 2.0
# Amount of particles to be spawned. Be careful, larger values could cause FPS drops.
Amount: 2000
# Speed of the particles to be spawned. Must be a positive value or zero.
Speed: 1.0
# Allows the particles to be seen up to 256 blocks away.
Force: true
# Color of the particles. Only applicable when particle's name is REDSTONE
Red: 255
Blue: 0
Green: 255
# Size of the particles. Must be a positive value. Only applicable when particle's name is REDSTONE
Size: 2.0
# This section allows to specify the sound to be played when the entity explodes.
Sound:
# Name of the sound to be played. Valid values are listed in
# https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html
Name: ENTITY_OCELOT_HURT
# Volume of the sound to be played. Must be a positive value. Values greater than
# 1.0 will not increase the loudness of the sound, but will allow the sound to be heared
# in a greater radius.
Volume: 1.0
# Pitch of the sound. Must be between 0.5 and 2.0, and allows to specify the speed
# the sound is played at.
Pitch: 1.0
# This section contains the materials that will be managed by the plugin.
# It is not mandatory: if this section doesn't exist, the plugin will understand that
# every section in the entity is a material. That can be used as a shortcut when
# you don't want to add entity properties, but only to list the affected materials.
# The damage to all those materials is "simulated" by the plugin and managed
# by these settings.
Materials:
# Valid values are all materials listed in
# https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html.
# WATER and LAVA are not allowed.
# Groups can also be used here.
unbreakableBlocks:
# Base damage used to compute the effective damage taken by a block.
# [Minimum] is 0.0, which means the block isn't affected by the explosion.
# [Default] is the same value as BlockDurability.
# Values greater than BlockDurability are allowed.
#
# NOTE: Effective damage is calculated according to the following formula:
# effectiveDamage = baseDamage * underwaterDamageFactor * (1 - distanceFactor * distanceAttenuationFactor)
# where distanceFactor = distance / explosionRadius
Damage: 150.0
# Indicates the chance of naturally breaking the block (and thus having drops).
# [Minimum] [default] is 0.0, which means blocks will never break naturally.
# [Maximum] is 100.0, which means blocks will always break naturally.
DropChance: 0.0
# Indicates how effective damage decreases with distance.
# [Minimum] [default] is 0.0, which means that all blocks in range will
# take the same amount of damage.
# [Maximum] is 1.0, which means that effective damage decreases linearly as
# distance increases.
DistanceAttenuationFactor: 0.0
# Damage multiplicative factor applied when explosion takes place underwater.
# [Minimum] is 0.0, which means no damage will be taken underwater.
# [Default] is 0.5, which halves the damage taken in underwater explosions.
# A value of 1.0 means that water doesn't affect damage.
# A value greater than 1.0 means damage underwater is magnified.
UnderwaterDamageFactor: 0.5
# Specifies when UnderwaterDamageFactor is applied.
# False [default]: Look for water in the explosion center. (faster)
# True: Trace a ray from the explosion center to each block and look for water. (fast)
FancyUnderwaterDetection: false
# Note how Particles and Sound sections can also be placed here, in the material section.
Particles:
Name: BLOCK_CRACK
DeltaX: 5.0
DeltaY: 5.0
DeltaZ: 5.0
Amount: 2000
Speed: 1.0
Force: true
# Some particles require a Material to be specified.
Material: OBSIDIAN
Sound:
Name: BLOCK_SAND_BREAK
Volume: 1.0
Pitch: 1.0
# Not affected by the explosion of any "dangerousEntity"! Will never break...
#DIRT:
#Damage: 0.0
# This section allows to customize the behaviour of Cannons explosions.
# The support for Cannons will be enabled automatically when it is detected.
CannonProjectile:
# Cannon projectile IDs
diamond:
Properties:
ExplosionDamageBlocksUnderwater: true
# Overriding the original projectile explosion also means that all side effects
# managed by Cannons (like spawning fireworks, cluster bombs, etc.) will be disabled.
# This is a limitation of the Cannons API, and can't be fixed by ExplodeAny.
ReplaceOriginalExplosionWhenUnderwater: true
UnderwaterExplosionFactor: 0.5
Materials:
# Contrary to what happens in the VanillaEntity section, it's not possible to override
# the behaviour of blocks that would break in regular conditions when a Cannon projectile
# explodes. That means that putting breakable materials here (like DIRT) won't have the desired
# effect.
OBSIDIAN:
Damage: 50.0
DropChance: 0.0
DistanceAttenuationFactor: 0.0
UnderwaterDamageFactor: 1.0
FancyUnderwaterDetection: false
# This section allows to customize the behaviour Magic entities explosions.
# The support for Magic will be enabled automatically when it is detected.
# This section behaves exactly as the VanillaEntity section, but will affect only
# to entities spawned by Magic and not to vanilla entities. Allowed entity values are:
# WITHER, ENDER_CRYSTAL, PRIMED_TNT, MINECART_TNT, CREEPER, CHARGED_CREEPER,
# FIREBALL, DRAGON_FIREBALL, SMALL_FIREBALL, WITHER_SKULL, CHARGED_WITHER_SKULL,
# BED, RESPAWN_ANCHOR
MagicEntity:
PRIMED_TNT:
unbreakableBlocks:
Damage: 25.0
# This section allows to customize the behaviour of custom Vanilla entities explosions, which
# are entities introduced by mods in Forge servers.
# Any entity name can be used here, since there's no way to check if the entity exists.
CustomEntity:
# From https://www.curseforge.com/minecraft/mc-mods/mrcrayfishs-gun-mod, for example.
CGM_MISSILE:
Properties:
# We need to specify the ExplosionRadius manually, otherwise a warning will be thrown and
# the entity won't be taken into account, since there's no way for ExplodeAny to know it.
ExplosionRadius: 4.0
Materials:
Obsidian:
Damage: 50.0
# All colors and modifiers are available for locale messages.
# Some messages allow to use placeholders, which are replaced by the plugin with the corresponding
# value. Placeholders are represented by %PLACEHOLDER_NAME%.
# The following placeholders are available:
Locale:
# - NotAllowed:
# (None)
NotAllowed: "You are not allowed to perform this action!"
# - Usage:
# %DESCRIPTION% represents the command's description
Usage: "Usage: %DESCRIPTION%"
# - OnlyPlayerAllowed:
# (None)
OnlyPlayerAllowed: "Only players can perform this action!"
# - PlayerDoesntExist:
# %NAME% represents the player's name
PlayerDoesntExist: "Player %NAME% doesn't exist in the server!"
# - PlayerIsOffline:
# %NAME% represents the player's name
PlayerIsOffline: "Player %NAME% must be online to perform that"
# - EnterChecktoolMode:
# %ITEM% represents the checktool item's name
# %PRETTY_ITEM% represents the checktool item's name in a more readable way
EnterChecktoolMode: "You can now right-click a block with %PRETTY_ITEM% to display block durability"
# - LeaveChecktoolMode:
# %ITEM% represents the checktool item's name
# %PRETTY_ITEM% represents the checktool item's name in a more readable way
LeaveChecktoolMode: "You can no longer check for a block durability"
# - ChecktoolToggledOn:
# %NAME% represents the player's name
ChecktoolToggledOn: Checktool mode toggled on for player %NAME%
# - ChecktoolToggledOff:
# %NAME% represents the player's name
ChecktoolToggledOff: Checktool mode toggled off for player %NAME%
# - ChecktoolUse:
# %MATERIAL% represents the clicked block's type,
# %PRETTY_MATERIAL% represents the clicked block's type in a more readable way,
# %B_X% the X coordinate of the targeted block
# %B_Y% the Y coordinate of the targeted block
# %B_Z% the Z coordinate of the targeted block
# %DURABILITY% the clicked block's durability and
# %MAX_DURABILITY% the maximum durability a block can have (same as BlockDurability),
# %DURABILITY_PERCENTAGE% the clicked block's durability as a percentage (excluding the % symbol)
ChecktoolUse: "Block health: %DURABILITY_PERCENTAGE%% (%PRETTY_MATERIAL%)"
# - ChecktoolSet:
# %ITEM% represents the checktool item's name
# %PRETTY_ITEM% represents the checktool item's name in a more readable way
ChecktoolSet: "Checktool successfully set to %PRETTY_ITEM%!"
# - ChecktoolNotPersisted:
# %ITEM% represents the checktool item's name
# %PRETTY_ITEM% represents the checktool item's name in a more readable way
ChecktoolNotPersisted: "Checktool item was set to %PRETTY_ITEM%, but it couldn't be persisted"
# - ChecktoolGiven:
# %NAME% represents the player's name
# %ITEM% represents the checktool item's name
# %PRETTY_ITEM% represents the checktool item's name in a more readable way
ChecktoolGiven: "A checktool (%PRETTY_ITEM%) was given to player %NAME%"
# - ChecktoolReset:
# (None)
ChecktoolReset: "Checktool successfully reset to bare hand (Air)"
# - ChecktoolNotHandled:
# %MATERIAL% represents the clicked block's type,
# %PRETTY_MATERIAL% represents the clicked block's type in a more readable way
ChecktoolNotHandled: "%PRETTY_MATERIAL% is not handled by the current configuration"
# - ChecktoolInfo:
# %ITEM% represents the checktool item's name
# %PRETTY_ITEM% represents the checktool item's name in a more readable way
ChecktoolInfo: "Current checktool item: %PRETTY_ITEM%"
# - DisabledInThisWorld:
# (None)
DisabledInThisWorld: "This functionality is disabled in this world"
# - Reloaded:
# (None)
Reloaded: "Reloaded successfully!"
# - DebugEnabled:
# (None)
DebugEnabled: "Debug mode has been enabled"
# - DebugDisabled:
# (None)
DebugDisabled: "Debug mode has been disabled"
# Prefix for all locale messages
LocalePrefix: "[ExplodeAny] "
# Use this section to disable the plugin in certain worlds
# Notice that world names are case sensitive
DisabledWorlds:
# - My_example_world_with_no_ExplodeAny
Throwable Creeper Eggs configuration:
creeper-egg:
glowing: false
material: CREEPER_SPAWN_EGG # Change for different versions of Minecraft
display-name: "&eThrowable Creeper Egg"
lore:
- "&8Sssssssssssss"
- "&fLeft Click &7in the air"
creeper-egg-charged:
explosion-radius: 10
glowing: true
material: CREEPER_SPAWN_EGG # Change for different versions of Minecraft
display-name: "&bCharged &eThrowable Creeper Egg"
lore:
- "&8Sssssssssssss"
- "&fLeft Click &7in the air to throw"
- "&FDouble Explosion Size"
options:
throw-requires-permission: false
allow-placement-of-egg: false
time-to-explode: 1
explosion-radius: 5
explosion-entity-damage-percentage: 100.0 # The percentage of damage that an entity will take from an explosion.
use-any-creeper-egg: true # Only applies if the material is a creeper spawn egg
use-creeper-fuse-animation: false # Only 1.15+ and looks weird if "time-to-explode" is more than 2
throwing-velocity-multiplier: 1.0
explode-in-mid-air: true # The value is ignored if "use-creeper-fuse-animation" is true
explosion-destroys-blocks: true # The value is ignored by "include-spawners-in-explosion"
explosion-damages-entities: true
include-spawners-in-explosion: true # The value of "explosion-radius" needs to be 2 or higher for spawners to be included
use-throwing-cooldown: true # The value specifies if there is a cooldown between throwing creeper eggs.
throwing-cooldown-in-seconds: 1.0 # The cooldown in seconds for the normal throwable creeper eggs.
throwing-charged-cooldown-enabled: false # The value specifies if charged throwable creeper eggs have a separate cooldown or not.
throwing-charged-cooldown-in-seconds: 1.0 # The cooldown in seconds for the charged throwable creeper eggs.
hide-creeper-when-exploding: false # Works best when not thrown into unloaded chunks
# There are four types of cobweb interactions: VANILLA, BOUNCE, DESTROY, EXCLUDE
# The "VANILLA" type will not change the behaviour of thrown eggs touching cobwebs.
# The "BOUNCE" type will make it so that thrown eggs bounce off of cobwebs when touched from the side or the bottom.
# The "DESTROY" type will make it so that thrown eggs are destroyed upon touching a cobweb.
# The "EXCLUDE" type will make it so that the thrown egg explosion does not destroy any cobwebs.
cobweb-interaction-type: VANILLA
# There are two types of filter-types: INCLUDE, EXCLUDE
# The "EXCLUDE" type will exclude any blocks from exploding that are in the "filtered-blocks" list.
# The "INCLUDE" type will include blocks in the explosion that are in the "filtered-blocks" list, but any
# other block is excluded if not in the "filtered-blocks" list.
block-explode-filter:
enabled: false
filter-type: EXCLUDE
filtered-blocks:
- DIAMOND_ORE
- DIAMOND_BLOCK
messages:
no-permission-cmd: "&7[&aTCE&7] &fYou're missing the permission to use this command!"
no-permission-throw: "&7[&aTCE&7] &fYou're missing the permission to throw creeper eggs!"
no-permission-place: "&7[&aTCE&7] &fYou're missing the permission to place creeper eggs!"
egg-given: "&7[&aTCE&7] &fYou gave &7</amount>x &eThrowable Creeper Egg(s) &fto &e</player>&f!"
invalid-player: "&7[&aTCE&7] &fThe player you're trying to give an egg to is not online!"
invalid-cmd-usage: "&7[&aTCE&7] &fInvalid usage. Use &e/tce give <player> <type> <amount>&f!"
invalid-argument: "&7[&aTCE&7] &fInvalid argument. Use &e/tce give &for &e/tce reload&f!"
reloaded-config: "&7[&aTCE&7] &fSuccessfully reloaded the &econfig&f!"
throwing-while-cooldown: "&7[&aTCE&7] &fYour eggs are on cooldown. You cannot throw eggs for another &e</remaining> &fsecond(s)."
compatibility:
coreprotect:
enabled: false
log-format: "#thrown_creeper_egg_by_</player>"
# You can change the default mobs and percentages or add more mobs with the same format under the "percent-chances" section.
# The percentages are out of 100. If the randomly generated number is the percentage chance or under, it will qualify as a drop.
# If "affected-by-looting" is true, then the drop chance will be increased by a certain amount when using a looting sword.
# The chance formula is: ( looting level / ( looting level + 1.5 ) ) * looting multiplier
# When using the default looting multiplier of 15, the maximum chance increase is 10%.
# ! Only one egg will be dropped - even if using a looting sword !
# | Only drops if the killer is a player |
drop-configuration:
enabled: false
affected-by-looting: false
looting-multiplier: 15
drop-chances:
creeper: 3
pillager: 1.5
# If enabled, a thrown creeper egg has a chance out of 100 of becoming a charged creeper when exploding.
# If the creeper is charged, then the explosion radius defined in the "options" section will be
# multiplied by the "explosion-radius-multiplier".
randomly-charged:
enabled: false
charged-chance: 10
explosion-radius-multiplier: 2
It seems this is not exactly a bug: when the creeper egg is thrown underwater and both "ExplosionDamageBlocksUnderwater" and "ReplaceOriginalExplosionWhenUnderwater" are set to true for creepers in ExplodeAny, the original explosion event is cancelled and a custom one is created (see https://github.com/GuilleX7/ExplodeAny/blob/main/explodeany/src/main/java/io/github/guillex7/explodeany/explosion/ExplosionManager.java#L181).
This behavior can also be reproduced by just setting "ReplaceOriginalExplosion" to true and throwing eggs anywhere: since ExplodeAny cancels the original event, the same behaviour occurs (see https://github.com/GuilleX7/ExplodeAny/blob/main/explodeany/src/main/java/io/github/guillex7/explodeany/explosion/ExplosionManager.java#L186)
As a workaround, I suggest to disable both "ReplaceOriginalExplosion" and "ReplaceOriginalExplosionWhenUnderwater" until compatibility with the plugin is added (via new entity section). Suggest the owner of the plugin to add a configuration key to allow disabling this behavior of spawning eggs when creeper explosion is cancelled by other plugins.