-
Notifications
You must be signed in to change notification settings - Fork 0
Home
ExplosiveElytras is a light-weight plugin built using the Spigot API. This plugin causes explosions to occur when a player impacts an object at a high velocity. These explosions only occur if the player has a certain item in their inventory, such as tnt. This plugin is highly configurable, allowing you to customize the conditions which trigger explosions.
These explosions can only be triggered if a player takes damage. This means that explosions can only occur if a player is in survival mode. Vertical impacts only cause explosions if fall damage is enabled as well.
A Developer API is provided and actively maintained. More details on this are provided below.
- Allow high speed elytra collisions to cause explosions.
- Configure which items a player must have in order to explode on impact.
- Configure minimum required amounts for each of those items.
- Choose whether or not the matching required item should be consumed on explosion.
- Configure the explosion power per required item.
- Enable/disable an explosion multiplier. If more required items are found in a player's inventory the explosion will be larger.
- Configurable limit for the maximum explosion power.
- Configure details about the explosion itself.
- If blocks should be destroyed.
- If fire should be spread.
- Configurable death message when a player dies in an explosive collision.
- Configurable values for both vertical and horizontal impacts:
- Set a minimum damage value required to trigger explosions.
- Enable/disable fireworks on explosion.
- Metrics by bStats
- WorldGuard Integration
- Developer API with Maven and Gradle support.
Some protection/logging plugins may not guard against the BlockExplodeEvent. This is the event which is triggered by explosions in this plugin. If the protection plugin you are using is out of date (no updates in several years), destroyed blocks may not be logged.
Below is a list of common protection plugins and their status on this.
-
β WorldGuard 7: Integrated support added. Details:
- NOTE WorldGuard integration is only available for WorldGuard 7 (1.13+). If you need WorldGuard integration for an older server version running WorldGuard 6, you will have to use v0.10.2 of ExplosiveElytras.
- Explosions will not occur if
block-tnt
is set to true. - Explosions will not occur in regions where the
tnt
flag is set to deny. - If
block-tnt-block-damage
is set to true explosions will still occur but will not damage blocks. - You will not blow up in regions where you're not a member unless you have the bypass permission.
- In the latest WorldGuard versions, the configuration option
explosion-flags-block-entity-damage
is enabled by default. This will cause ExplosiveElytras to work improperly. Please disable it.
- β GriefPrevention: Supports this event.
- β CoreProtect: Supported in CoreProtect v2.15.0+. (issue)
- β LogBlock: Supported as of commit defcfee. This is available on the LogBlock build server.
These are the 4 major plugins that we have tested. If you use another protection plugin please check with us.
Command | Description | Required Permission |
---|---|---|
/ExplosiveElytras help | View the command list. | - |
/ExplosiveElytras version | View version information. | - |
/ExplosiveElytras reload | Reload the configuration file. | explosiveelytras.reload |
Commands are hidden from the command list if you lack permission to use them.
Permission | Description | Default |
---|---|---|
explosiveelytras.* |
Grants all permissions for this plugin. | OP |
explosiveelytras.explode |
Access to explode on collisions. | OP |
explosiveelytras.bypass.worldguard |
Access to explode in regions where you're not a member. | OP |
explosiveelytras.reload |
Access to reload the configuration. | OP |
explosiveelytras.*
explosiveelytras.explode
explosiveelytras.bypass.worldguard
explosiveelytras.reload
#-----------------------------------------------
# Explosive Elytras Config
#-----------------------------------------------
#DO NOT CHANGE THIS VALUE.
#CHANGING IT COULD RESULT IN DATA LOSS.
ConfigVersion: 1.0
#--------------[General Settings]---------------
general_settings:
# A player must have at least one of the following
# in their inventory at the time of crash in order
# to explode. Leave this empty for no requirement.
# Syntax is [MATERIAL]|[amount]
# Ex. TNT|1 = 1 tnt, SULPHUR|64 = 64 gunpowder
# List of spigot materials: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
required_items:
- "TNT|1"
# The power of the explosion per required item found.
# This will be the total power of the explosion if
# the explosion multiplier is disabled.
# The power of a single tnt explosion is 4.
power_per_item: 4
# If enabled the power of the explosion will increase
# if you have more of a required item in your inventory.
# The power will grow until it reaches the max power.
# If disabled then the power of the explosion will be equal
# to the power of one item (defined above).
explosion_multiplier:
enabled: true
max_power: 16
# Should the matching required item be consumed during
# the explosion.
consume_on_explosion: true
# Users will only blow up in the following worlds.
# If left empty this plugin is essentially disabled.
allowed_worlds:
- world
- world_nether
- world_the_end
# Choose a death message for explosive landings.
# Use {0} for the player's name, color codes and
# formatting are supported.
death_message: "{0} had an explosive landing"
#-------------[Explosion Settings]--------------
# Settings explosion creation and handling. Note
# that some of these settings may be overriden by
# your server's protection plugin.
explosion_settings:
# Should blocks be damaged by the explosion.
break_blocks: true
# Should fire be created by the explosion.
set_fire: true
# Should fireworks be launched when you explode from a crash.
fireworks: true
# Should the elytra the player is wearing be consumed
# during the explosion. This method is preferable to
# simply adding the elytra to the required items list,
# as only the chestplate slot is checked (ie only the
# elytra currently worn will be consumed).
consume_elytra: false
#---------[Horizontal Impact Settings]----------
# Settings for when a player crashes into something
# horizontally, like a wall.
horizontal_impact_settings:
# Minimum damage on the player to cause an explosion.
# 1 = .5 hearts, 2 = 1 heart, 3 = 1.5 hearts, etc.
minimum_damage_value: 1
#---------[Vertical Impact Settings]----------
# Settings for when a player crashes into something
# verically, like the ground.
vertical_impact_settings:
# Minimum damage on the player to cause an explosion.
# 1 = .5 hearts, 2 = 1 heart, 3 = 1.5 hearts, etc.
minimum_damage_value: 10
If you want to hook explosive elytras into your own plugin or simply want to extend functionality, you may use the provided API. The api is currently in its infancy, therefore if you feel anthing is missing or should be changed, please let us know.
Javadocs are not hosted, however they are provided on the maven repository.
<repository>
<id>jcenter</id>
<name>jcenter-bintray</name>
<url>http://jcenter.bintray.com</url>
</repository>
<dependency>
<groupId>com.dscalzi</groupId>
<artifactId>ExplosiveElytras</artifactId>
<version>VERSION</version>
</dependency>
repositories {
jcenter()
}
dependencies {
implementation 'com.dscalzi:ExplosiveElytras:VERSION'
}
public class ExampleListener implements Listener {
private final Map<UUID, ExplosiveImpactEvent> EVENT_CACHE = new HashMap<UUID, ExplosiveImpactEvent>();
@EventHandler
public void onExplosiveImpact(ExplosiveImpactEvent e) {
// Do not consume items with a certain lore.
List<ItemStack> consumedItems = e.getConsumedItems();
for (int i = 0; i < consumedItems.size(); i++) {
ItemStack target = consumedItems.get(i);
if (target.hasItemMeta()) {
ItemMeta targetMeta = target.getItemMeta();
if (targetMeta.hasLore()) {
loreLoop: for (final String s : targetMeta.getLore()) {
if (s.equals("Ancient Protection")) {
// Do not consume items with Ancient Protection.
consumedItems.remove(i);
break loreLoop;
}
}
}
}
}
// Do not deal damage if the player has armor with
// a certain lore.
final Player p = e.getPlayer();
itemLoop: for (ItemStack i : p.getInventory().getArmorContents()) {
if (i.hasItemMeta()) {
ItemMeta targetMeta = i.getItemMeta();
if (targetMeta.hasLore()) {
for (final String s : targetMeta.getLore()) {
if (s.equals("Guardian Blessing")) {
// Do not do damage to players with a Guardian Blessing.
// We cache this event because damage can only be edited
// through the ExplosiveDamageEvent.
EVENT_CACHE.put(p.getUniqueId(), e);
break itemLoop;
}
}
}
}
}
}
@EventHandler
public void onExplosiveDamage(ExplosiveDamageEvent e) {
final Player p = e.getPlayer();
if (EVENT_CACHE.containsKey(p.getUniqueId())) {
// Cached events do not do damage. See above method.
e.setExplosionDamage(0);
e.setImpactDamage(0);
EVENT_CACHE.remove(p.getUniqueId());
}
}
}