/throw-better

A script add-on for minecraft bedrock to allow throwable items without using player.json

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

Throw Better

A Minecraft Bedrock script for throwable items WITHOUT using player.json! With a json structure for defining throwable items, you can easily configure settings per item, in a familiar format even if you don't understand the Minecraft scripting API. Settings include what to throw and how often to throw it.

Features:

  • No player.json
  • Easy to add items
  • Reloadable items
  • Customizable options:
    • Fire rate
    • Projectile speed
    • Ammo
      • Scoreboard or item
      • Consume amount
  • Single fire option
  • Reloading
    • Reload time
    • Ammo

Usage

This requires pre-existing item that can be used in your BP

  1. Open the scripts/throwables.js file
  2. Add your items as json objects
  3. Define the fireRate, projectile, and projectileVelo
  4. Optionally define the ammo object

Documentation

Throwables.js

Name Description
fireRate Delay in ticks between each time the item is thrown (20 ticks/second). Required
projectile The projectile that will be thrown. Required
projectileVelo The speed that the projectile will be thrown at. Required
ammo Object that defines the item’s requirements for ammo. Optional
item The item that the throwable will consume. This can be the same as the throwable item, but will not allow for fast custom throw speeds. Required if scoreboard undefined
scoreboard The object of the scoreboard to track ammo Required if item undefined
name The name of the scoreboard item Required
max The number of ammo for the throwable item Required
emptyItem The item that the player will get once they are out of ammo Optional
consume The amount of items to consume from the player’s inventory Required, but will default to one if undefined
singleFire Whether the item will fire once per button press or not. Optional - Defaults to false

Reloadables.js

Name Description
reloadTime Time in ticks before player gets the reloaded item back. Required
reloadedItem Item that will be given to the player when they reload. Required
ammo Object defining the item’s ammo requirements. Required
item Item that will be consumed by reloading. Required
amount Amount of the item required for reloading. Required
scoreboard Object defining the scoreboard for the item. Optional
name Name of the scoreboard to add ammo to. Should be the same as the scoreboard of the throwable. Required, but will default to the scoreboard of the reloadedItem’s scoreboard in throwables.
max Number of ammo to add to the scoreboard when reloading. Required