[1.8 to 1.21] Throwing Weapons icon

[1.8 to 1.21] Throwing Weapons -----

Create Throwing Weapons in MC! Craft, Permission, Effect, Damages, etc...




  • Added support for PlaceholderAPI
  • Split commands on hit depending on whether a player or an entity is hit.
  • Improved throwing weapons default placeholders.
Placeholders can be used in commands on hit or kill, along with the messages in config.yml.

Example config:
Code (YAML):
on-hit :
  # Commands to execute when the weapon hits an entity.
  # Commands executed as console!
  #
  # %tw_thrower% -> The name of the player who threw the weapon.
  # %tw_hit% -> Player: their name.
  #          Entity without name: Type of entity. (e.g. "Pig", "Villager").
  #          Entity w/ custom name: Its custom name.
  # %tw_item% -> The display name of this weapon. (of the item).
  # %tw_item_original% -> The display name defined in Throwing Weapons
  #                       This will be different from %tw_item% if
  #                       using Nexo, Oraxen, or ItemsAdder.
  # %tw_id% -> The ID of the item.
  #
  # --- Supports PlaceholderAPI!
  # The player is always the thrower. You can also use the name of
  # the other player with %tw_hit%
  #   Example: %otherplayer_level_%tw_thrower%%
  commands-on-hit-player
:
   - 'say %player_name% (%player_level%) hit %tw_hit% (%otherplayer_level_%tw_hit%%) with %tw_item%!'
  commands-on-hit-entity
:
   - 'say %player_name% hit entity %tw_hit% with %tw_id%!'
----------, Feb 7, 2025

  • Refactored some parts of the code
  • Removed useless debug code
  • Minor fixes, including performance
  • Added support for Nexo!
Nexo support

In any weapon config, add:
Code (YAML):
nexo:
  enabled
: true
  nexo-id
: amethyst_hammer
Or use /tw register <name> while holding a Nexo item.
----------, Feb 7, 2025

Added commands that are run when killing a player and when killing an entity.

Please add the following to your config:
Code (YAML):
# Commands executed when the weapon kills a non-player entity.
commands-on-kill-entity
:
 - 'say %thrower% hit entity %hit% with %item%'

# Commands executed when the weapon kills a player.
commands-on-kill-player
:
 - 'say %thrower% hit player %hit% with %item%'
If you want to avoid running hit commands when killing, you can add this to your on-hit config:
Code (Text):
on-hit:
  ...

  run-commands-on-kill: false
----------, Feb 5, 2025

  • Fixed a bug where players could not use their axe on trees if it is a throwing weapon.
----------, Feb 4, 2025

  • ItemsAdder support fix
----------, Jan 13, 2025

  • Added experimental ItemsAdder support

Example config:
Code (YAML):
# You can also use the plugin ItemsAdder for custom items, instead of custom model data.
# 1.14+ only too
itemsadder
:
  enabled
: false
  itemsadder-id
: your_custom_item
Simple insert that at the end of a weapon's config.

Please report issues on the Discord server.
----------, Jan 13, 2025

  • Fixed purpur support (for <1.21 versions)
----------, Jan 13, 2025

  • Fixed shields not blocking weapons
  • Added config option for making throwing weapons go through shields
----------, Jan 4, 2025

  • Added 1.21.3 and 1.21.4 support
----------, Dec 4, 2024

  • Fixed Purpur support (on 1.21.1 mainly)
----------, Sep 27, 2024

  • Added Hex Color codes support
  • Slightly changed how crafting recipes are added. Should be more consistent over reloads.
----------, Sep 13, 2024

  • Fixed Oraxen Support for Right/Left click weapons
----------, Jul 14, 2024

  • Fixed Oraxen Support for recent Minecraft versions.
----------, Jul 11, 2024

  • Fixed support for NMS in Purpur, tested on 1.20.6 and 1.21, please report issues for other versions on the Discord server.
----------, Jul 6, 2024

Added 1.21 support & tested.
----------, Jun 30, 2024

Added 1.20.6 Support. Please note this requires Java 21!
----------, Jun 6, 2024

This update brings new settings for modifying the trajectory, notably related to gravity.

Due to Minecraft's physics, this is not straightforward. A dependent drag is applied to entities in the air, which prevents creating simple settings.

Several options are present with this update.

  1. Max Living Ticks: This new setting allows to drop/return to inventory weapon after the defined number of ticks. This can be used to prevent weapons from staying in the air with the other new settings, or simply to prevent weapons from going too far.
  2. Straight Trajectory: Throwing Weapons now allows to make the weapons follow a straight trajectory. This will ignore Minecraft's physics and thus ignore the next two options. This is a simple workaround that most other similar plugins employ. This should be used with Max Living Ticks enabled, or the weapon could stay in the air indefinitely!
  3. Maximum Y Velocity: This allows for setting the maximum vertical (negative) velocity. If you set 0.1, then the weapon will never fall faster than -0.1 block/tick. This allows slowing down the fall of weapons and make them reach a longer range. Minecraft applies drag to entities in the air, which makes them slow down also along x and y. If you set this to 0.0, the weapon could stay in the air indefinitely! Please use cautiously and/or with max living ticks.
  4. Anti-Gravity: This can be used with the setting above or without. This will apply a vertical counter-acceleration (upwards), so instead of setting a maximum fall velocity, you simply apply a counter velocity. This will slow down gravity but again, use cautiously.
These features are experimental, they have been tested thoroughly but please report any issue on the Discord server.

To use these settings, add this snippet to the end of your yml weapon files, then edit and reload.
Code (YAML):
# This setting overrides all the others.
# If enabled, the weapon keeps a constant
# speed along a straight trajectory.
# The speed is the one set in the speed
# setting above multiplied by this factor.
#
# This SHOULD be used with
# max-living-ticks enabled!!
straight-trajectory
:
  enabled
: false
  multiplier
: 0.3

# Max living ticks for the weapon.
# 1 tick = 0.05 seconds.
# 20 ticks = 1 second
max-living-ticks
:
  enabled
: true
  value
: 50

# These settings allow for affecting the
# gravity and can make the weapon
# fall slower (have a longer range)
# without requiring a very high speed.
#
# Warning, these settings can make the
# weapon act weirdly and stay
# in the air for a long time.
# Preferably use with max-living-ticks
# enabled, or use straight-trajectory
# with max-living-ticks.
gravity-modifiers
:
  # Maximum Y velocity for the weapon.
  # if velocity y <= -value, the weapon
  # will not accelerate more downward.
  max-y-velocity
:
    enabled
: false
    value
: 0.1
  # At each tick, this value is added
  # to the weapon's velocity y (upward).
  anti-gravity
:
    enabled
: false
    value
: 0.1
----------, Mar 17, 2024

  • Updated default Towny API, should not require any change on your side.
  • Updated default config to have pvp using throwing weapons in Towny towns with no pvp to be disabled by default, as it makes more sense.
The second addition will only affect new config.yml files generated.
----------, Feb 13, 2024

Added & tested support for 1.20.4.
----------, Jan 14, 2024

  • Updated support for sounds. The weapon config files now support all sounds from 1.8 to 1.20 (included).
  • Fixed some issues in the weapon file parser in case of incorrect settings, notably potion effects.
  • Fixed incorrect dropping of the weapons causing them to disappear or clip through blocks.
----------, Aug 24, 2023

  • Fixed an issue where the entity on which a player throwing weapon is gets damaged by the weapon. The entity is now ignored and the weapon goes through it.
  • Added an optional knockback effect to throwing weapons.
    Add the following to your weapon config file (or create a new weapon):

    Code (YAML):
    knockback:
        enabled
    : true
        # Knockback vertical component
        vertical
    : 0.2
        # Knockback strength
        strength
    : 1.0
----------, Aug 18, 2023

  • Added & tested support for 1.20
----------, Jun 11, 2023

  • Fixed invalid amount in crafting result
  • Removed usage of System.out to print in console (suppresses Spigot warnings)
----------, May 14, 2023

Revert wrong version
----------, May 5, 2023

  • This
  • is
  • aa

TEST
bbbbb
----------, May 5, 2023

  • Added Support for 1.18.x and 1.19.x versions.
----------, May 5, 2023

  • Now supports Oraxen latest version (1.112.1) for 1.16 and 1.17.
  • 1.16 and 1.17.1 now both require running Java 16.
  • Versions below 1.16 do not need Java 16 anymore and will run on any other version of Java greater or equal to Java 8.
  • 1.17 is NOT supported, please use 1.17.1.
----------, Aug 25, 2021

Added 1.17 Support
----------, Jun 22, 2021

  • Now, if a weapon has both custom model data and override default mc item enabled, it will override only mc items with the custom model data. So it won't look at the display name, lore etc.
----------, Apr 11, 2021

  • Fixed server crash due to launching too many weapons right after another with cooldown = 0
  • Fixed cooldown issues: use cooldown = 0 or -1 to remove the cooldown of a weapon.
  • Fixed 1.16.5 Support.
  • Fixed other minor asynchronous error and crashes due to bad multithreading.
----------, Mar 3, 2021

Added 1.16.4 Support
----------, Nov 15, 2020

  • Fixed weapon disappearing when go-back-to-inventory is true and the inventory is full. Weapon will now drop on the ground
  • Minor optimizations on different weapon checks
----------, Oct 15, 2020

Added 1.16.2 Support
----------, Aug 28, 2020

  • Fixed mobs targetting the thrower even when they are in creative.
  • Fixed throwing wepaons armor stands getting marked as projectiles in some events, leading to incompatibility with other plugins.
  • Fixed no experience dropping from throwing weapons, and sometimes also from other experience source like ores.
  • Fixed some material multi-version compatibility.
  • Other minor fixes.
----------, Aug 20, 2020

  • Added support for Oraxen.
You can now, instead of configuring the item through the weapon config, you can use Oraxen with a custom model, etc.
Either you hold an oraxen item in hand and type:
/tw register <name>
Or you can add this to an existing weapon file:
Code (Text):
oraxen:
  enabled: true
  oraxen-id: item_id
  • Fixed 1.16 materials support and other minor fixes.
----------, Aug 17, 2020

  • Added support for new minecraft version 1.16
  • Fixed a duplication bug triggering the plugin to give the player the weapon several times.
----------, Jun 25, 2020

  • Changed value of
    pvpmanager_prevent_throw_if_not_in_combat
    to false by default as this setting was confusing.
----------, Jun 20, 2020

  • Added SaberFactions support
  • New config fields for SaberFactions support
----------, Jun 20, 2020

  • Fixed a rare error ("AssertionError: TRAP")
  • Disabled blocking throwing weapons in towny areas where pvp is disabled by default. New option in config to turn it back on.
  • Fixed a graphical issue.
----------, May 21, 2020

  • Fixed a NullPointerException error
  • Fixed weapons that can't be thrown in peaceful mode
----------, May 10, 2020

  • New command: /tw register <name>
Permission:
throwingweapons.command.register
Allows to create new weapons directly from in game. It will create a new config with default values, with item data corresponding to the item you're holding in game. A planned improvement is a GUI to configure the other default values. After creating the new weapon, it automatically loads it.
  • Fixed shapeless recipes not being registered.
  • Fixed shapeless recipes not producing the config-defined amount.
  • Minor other fixes.
----------, Sep 17, 2019

  • New hitbox system to make it possible to throw throwing weapons through 1-block-large holes for example.
[​IMG]
This system is in BETA. Please report any bug.

  • Fixed WorldGuard issues with the custom flag.
  • Added attributes (Only +1.14). You can add it to your config:
Code (YAML):
# Only on +1.14!
# Format: 'MODIFIER, SLOT, Operation, Amount
# List of modifiers:
#   - MAX_HEALTH
#   - FOLLOW_RANGE
#   - KNOCKBACK_RESISTANCE
#   - MOVEMENT_SPEED
#   - ATTACK_DAMAGE
#   - ATTACK_SPEED
#   - ARMOR
#   - ARMOR_TOUGHNESS
#   - LUCK
# List of slots:
#   - ANY
#   - HAND
#   - OFF_HAND
#   - HEAD
#   - CHEST
#   - LEGS
#   - FEET
# List of operations:
#   - AMOUNT
#   - PERCENTAGE
#   - MULTIPLY
modifiers
:
  enabled
: true
  list
:
   - 'MAX_HEALTH, ANY, MULTIPLY, 3'
----------, Sep 17, 2019

  • Updated WorldGuard support to 7.0.1
  • Fixed error with RIGHT_CLICK weapons.
----------, Sep 14, 2019

  • You can now add a custom model data to your items. Only works on 1.14.4!
Add the following config section at the end of your weapon file:
Code (YAML):
custom-model-data:
  enabled
: true
  value
: 1234567
  • Tab Completer for commands! Commands should now be faster to use.
[​IMG]

  • Added bStats support.
  • Other minor fixes and improvements.
Please report any bugs asap on the Discord!
Enjoy :)
----------, Sep 12, 2019

  • Fixed particles
  • Fixed item override not working on some materials.
----------, Aug 22, 2019

  • Fixed materials not working
----------, Aug 21, 2019

  • Added 1.14 Support
  • Fixed some item types not working like dyes.
  • Other minor fixes
----------, Aug 21, 2019

Fixed support for 1.13
Please report any issue with 1.13 on the Discord server!!

PLEASE READ
From now on, you'll need to use the text version of the material ids.
e.g. instead of 266, you'll use GOLD_INGOT!

For 1.13, you need to reset your config folder
----------, Apr 16, 2019

Added support for both 1.13 (v1_13_R1) and 1.13.1 (v1_13_R2)
----------, Oct 17, 2018

  • Fixed visual glitch when trying to repair throwing weapon.
----------, Sep 8, 2017

Fixed Enchanting Tables and Anvils
----------, Sep 4, 2017

  • Changed damage-animals flag to custom one in config. (default = damage-animals)
  • Fixed damaged items can't be thrown.
----------, Aug 13, 2017

  • Now throwing weapons won't throw on left/right click on objects such as furnaces, workbenches, brewing stands etc.
----------, Aug 13, 2017

  • Crafting with throwing weapons is now impossible.
  • Fixed CombatLogX support (again...)
  • Other minor fixes
----------, Aug 13, 2017

  • New Message when trying to hit a Clan Member.
  • Fixed hitting a creative player with CombatLogX support.
  • Fixed Pigmen and Endermen not targetting players hitting them with throwing weapons.
  • Added support for DAMAGE-ANIMALS WorldGuard flag.
  • Added delay bypass:
----------, Aug 13, 2017

Fixed VanishNoPacket conflict with Clans
----------, Aug 13, 2017

Fixed player couldn't hit anybody
----------, Aug 12, 2017

Fixed the following bugs:
  • allow-killing-animals-in-other-players-region doesn't work.
  • CombatLogX not supported
  • Couldn't throw to animals in Pvp denied arenas.
  • Other minor fixes.
----------, Aug 12, 2017

Bugs Fixed:
  • Players can kill animals in other players' regions (owners), now you can activate in config to remove this. (by default false).
  • Throwing removes whole stack of the item.
  • Other items than tools would not work and just disappear.
  • In CombatLog support, it was counting like entering combat if attacking a creative player.
  • Added support for Clans so players don't attack their clanmates.
  • Back-To-Inventory feature would cause the item to disappear if player's inventory was full, now it will simply drop where player is.
  • Other various minor issues.
Enjoy!
----------, Aug 11, 2017

  • Fixed duplication exploit
----------, Jul 3, 2017

  • Fixed minor issues like NPE with Damage Events.
----------, Jul 2, 2017

  • New small fix for WorldGuard with invicibility
----------, Jun 29, 2017

  • Fixed WorldGuard support
----------, Jun 29, 2017

Fixed CombatLog Support
----------, Jun 18, 2017

  • Will now trigger EntityDamageByEntityEvent so other plugins can detect when a player gets hit by armor stand.
----------, May 28, 2017

  • Added drop chance (toggleable) per weapon depending on hitting ground or entity.
By default it's off, add it to your config in the on-hit section this way:
Code (Text):
on-hit:
  # Potion Effects to give.
  # Format:
  # NAME, duration(in ticks), strength
  # List for NAME: http://bit.ly/28MDLG2
  potion-effects:
    - 'POISON, 60, 1'
    - 'BLINDNESS, 60, 1'

  # Put the entity on fire when hitting it.
  fire:
    enabled: false
    # duration (in ticks) 20ticks = 1 sec. 1 tick = 0.05seconds
    duration: 160

  # Commands to execute when the weapon hits an entity.
  # Commands executed as console!
  #
  # %thrower% -> The name of the player who threw the weapon.
  # %hit% -> Player: his/her name.
  #          Entity without name: Type of entity. (e.g. "Pig", "Villager").
  #          Entity w/ custom name: Its custom name.
  # %item% -> The name of this weapon. (of the item).
  #
  commands:
    - 'say %thrower% hit %hit% with %item%!'

  # Chance to drop when hitting ground (Out of 100)
  drop-chance-ground:
    enabled: false
    chance: 40

  # Chance to drop when hitting entity (Out of 100)
  drop-chance-entity:
    enabled: false
    chance: 40
----------, Apr 16, 2017

  • Added support for Combat Log when hitting an entity.
----------, Apr 16, 2017

Major fix: Plugin couldn't start (Obfuscation problem)
----------, Apr 16, 2017

  • Fixed duplication issue (MAJOR ISSUE) when throwing item from off hand (left hand)
  • config.yml: new delay from using any throwing weapons.
Enjoy!
----------, Apr 15, 2017

  • Fixed sounds not available (1.9 sounds)
  • Added new fire feature, puts the entity on fire when hitting it.
Add it to your config like this:
Code (Text):
# Actions executed when Throwing Weapon hits an entity.
on-hit:
  # Potion Effects to give.
  # Format:
  # NAME, duration(in ticks), strength
  # List for NAME: http://bit.ly/28MDLG2
  potion-effects:
    - 'POISON, 60, 1'
    - 'BLINDNESS, 60, 1'

  # Put the entity on fire when hitting it.
  fire:
    enabled: false
    # duration (in ticks) 20ticks = 1 sec. 1 tick = 0.05seconds
    duration: 160
----------, Apr 15, 2017

  • Fixed Towny Support
  • Added VanishNoPacket support
  • Added PvPManager support.
----------, Mar 26, 2017

Added support for Towny Regions.
----------, Mar 25, 2017

This version fixes WorldGuard PVP support.
----------, Mar 25, 2017

Fixed sounds, right/left click and creative decrease of durability
----------, Feb 28, 2017

  • Sounds on hit and throw:
Add this to your weapon files if you want this feature:
Code (Text):
# Sounds config
sounds:
  # Sound to play on hit.
  on-hit:
    # Enabled?
    enabled: true
    # Which sound? Sound List: http://pastebin.com/giyy6JKp
    sound: ARROW_HIT
  # Sound to play on throw.
  on-throw:
    # Enabled?
    enabled: true
    # Which sound? Sound List: http://pastebin.com/giyy6JKp
    sound: IRONGOLEM_THROW
  • Durability
Note: Only works for items that can have a durability (tools, weapons, armor, etc)
Add this to your weapon files if you want this feature:
Code (Text):
# Only works on items that have durability (swords, etc).
durability:
  # Should the item decrease at each use or not.
  decreases: true
  # How much it decreases at each use.
  decrease-per-use: 50
  • Throw Type
Wanna change from Dropping to throw? You can also set that you need to right or left click to throw.
Add this to your weapon files if you want this feature:
Code (Text):
# How should it be thrown?
# Possible:
#   DROP
#   LEFT_CLICK
#   RIGHT_CLICK
throw-manner: RIGHT_CLICK
 
----------, Feb 28, 2017

Bug Fixed:
  • Throwing Weapons could be thrown from/to invincibility flagged zones.
----------, Dec 21, 2016

  • Now checks Display Name & lore to launch and no longer infinity use tag.
  • New feature: Weapons can go back directly to thrower's inventory, just add:
    Code (Text):
    # Should the weapon go directly back in thrower when it hits something?
    goes-back-to-inventory: true
    To the config of the weapon to enable it, or don't do anything it will be disabled then.

    Enjoy :)
----------, Dec 18, 2016

40% OFF Christmas sale!
----------, Dec 17, 2016

Fixed:
  • Throwing a default item of Minecraft when the option for that is toggled on would rename it to the item in config. To resume: Throwing "Iron Sword" was renaming for example to Throwing Knife when on the ground.
----------, Dec 1, 2016

You can now completely override Minecraft's default items.
Add (or don't if you don't care) to the configs of your weapons:
Code (Text):
overrides-default-mc-item: true (or false)
:)
----------, Nov 24, 2016

  • Fixed commands
----------, Aug 22, 2016

  • Fixed: Weapon couldn't be thrown under some circumstances.
----------, Aug 22, 2016

  • Added Crafting Output Amount, you can add it to your existing config by adding the field manually, like here: http://pastebin.com/VS9L8Pvv
----------, Aug 5, 2016

  • Region doesn't need to have Flag PvP to ALLOW anymore. Having it to deny will prevent using throwing weapons, but having no flag will allow.
----------, Aug 4, 2016

  • Added Cooldown: Just add "cooldown: {number}" to your existing weapons, number is an integer, representing the ticks 1 second = 20 ticks, or remove weapons folder, and it'll generate the example.yml with it. If you don't add it, it'll be 0 (no cooldown).
  • Fixed WorldGuard.
----------, Aug 3, 2016

  • You can't throw in regions where pvp is not allowed.
  • You can't hit entities in regions where pvp isn't allowed.
----------, Aug 2, 2016

  • Items are now unbreakable
----------, Jul 21, 2016

FINALLY AN UPDATE!
Sorry for the delay..

But yeah, it's there, and it's good.
I remade it from 0. It's now more optimized, code cleaner, more options.
Please delete your folder when switching to 2.0!
Now, 1 file per weapon.

Commands!
/tw give
Give weapons to your players!
/tw reload
Reload config from game.

Permissions: http://pastebin.com/sncZ3sLf

It's the first release of it since it has been remade, so there might be issues.
Don't forget to report them in Discussion! I'll fix them as fast as possible.


Enjoy!
----------, Jul 13, 2016

  1. Now updated to latest Spigot version.
  2. You can now disable rotation, add 'rotation: true/false' to an item to disable/enable it. If you don't add, it won't turn.
Enjoy!
----------, Feb 27, 2016

Improvements about lags etc.
I'll work on a new a lot more optimised version later when I'll have some time because I'm getting very busy atm with Ultra Cosmetics, my server etc.
----------, Aug 25, 2015

Fixing Issue on Startup.
----------, Jun 22, 2015

Now you can make that the result item of the craft is damaged. It has been asked by a buyer for a compatibility with a "NoCraft" plugin.

Also default items are no longer necessary.
----------, Jun 20, 2015

Removed Debug Message and fixed trails
----------, May 31, 2015

Fixed duplication and improved blocking with sword system.
----------, May 31, 2015

Now working, removed the height bugs etc... Sorry for the delay.
----------, May 30, 2015

Sorry for that, my hitbox thing doesn't work very well, I mean the system to detect if it hits the players isn't very optimized. I'll try to work on that for next version so you hurt what the knife hits.
----------, Apr 30, 2015

I recompiled the plugin with latest spigot 1.8.3 build.
And I made the trajectory better.
enjoy :)
----------, Apr 30, 2015

Resource Information
Author:
----------
Total Downloads: 297
First Release: Apr 8, 2015
Last Update: Feb 7, 2025
Category: ---------------
All-Time Rating:
37 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings