How to make a Projectile

Section

What is a projectile?

A projectile is an entity that is shot from another entity or item. Projectiles can provide knockback and hit damage for the entity they hit. Projectiles can be used in the item element to make custom ranged weapons, as well as a custom ranged item for custom entities. You can also use projectiles using procedures using the blocks located under the projectile procedures tab.

Creation and naming

  • First, go to the workspace.
  • Next, click on Create New Element.
  • Select projectile
  • Type the name of your block. Names must not be repeated! The end-user will not see this name, so name it something you can identify easily. One way you can prevent your block name from being repeated is to put the mod type before your mod name, Example: TippedDart or ProjectileDart
  • Click next.

Properties

  • Required item for the projectile:
    • This is the item that will be used for the projectile (e.g. an arrow with a bow).
  • Projectile model:
    • If the default model is used the item is also a projectile model.
    • This allows you to set a custom JAVA model for your projectile.
    • You will also need to use the projectile model texture if you use a custom model.
  • Projectile model texture:
    • This allows you to set the texture for the custom model if you use one.
  • Projectile launch action sound:
    • This is the sound that plays when the projectile is used.
    • Arrows use the "entity.arrow.shot" sound.
  • Does projectile spawn particles in flight?:
    • Check this box if the projectile should spawn particles in mid-flight.
  • Default projectile power:
    • Power is used to determine the range and distance of the projectile.
    • More power can shoot straighter and further.
    • Less power makes more of an arch like a bow.
    • Set this value to 1 for the same value as a bow.
  • Default hit damage:
    • This is how much damage the projectile does when it hits an entity.
    • Higher values do more damage.
    • A value of 0.0 will deal half a heart of damage (1 health point)
    • Each 0.1 value deals with one additional health point.
    • For the player with 20 health points, it would require a value of 1.9 to kill the player.
      ((0.1 * 20) - (0.1)) = 1.9 you need to subtract 0.1 because 0.0 deals 1 point of damage.
  • Default hit knockback:
    • This is the amount of knockback the entity will receive when the projectile hits the entity.
    • Higher values increase the power of the knockback.
    • Vanilla arrows don't have a base knockback. The knockback is only applied with the `Konckback` enchantment
  • Does the projectile ignite fire on hit?:
    • Check this box if you want fire to be placed when the projectile hits a block.
    • This setting does not set entities on fire.

Triggers

  • When the projectile hits a block:
    • This will run a procedure when the projectile hits a block.
    • The position will be the location of the block.
  • When the projectile hits a living entity:
    • This will run a procedure when the projectile hits a living entity.
  • When the projectile hits a player
    • This will run a procedure when the projectile hits the player
    • Remember that this can also happen to the player shooting the projectile.
  • While projectile flying tick
    • This will run a procedure while the projectile is in motion before it hits something.
    • This will execute each tick.

After making a projectile

Once you have made a projectile you can use the projectile in procedures or you can enable an item element's Ranged item properties under the "Advanced properties" of the item. Read the item page How to Make an Item for more information.

 

The projectile can also be used with a custom entity by using the "Enable ranged attacks" on the left of the "AI and Goals" page.



Donate to MCreator

By donating to developers you can speed up development, as with more resources, we can dedicate more time to MCreator. It is a free project made by developers working on it in their free time.