Adding Durability to Equipment in RPG Maker MV with Yanfly

Joe Vincent
4 min readFeb 6, 2021
Sword breaking on attack — what we’re aiming to build.

I try not to use scripts when it comes to RPG Maker. I’ve found over the years that scripts are a very deep rabbit hole and can quickly lead to ever expanding project feature creep. However, sometimes there are systems or functionalities that simply cannot be worked around with events. Equipment durability is one of these.

Table of Contents

  1. Requirements
  2. Installation & Activation
  3. Adding Equipment Durability

Requirements

Before we can begin, you will need to have the following scripts:

  1. Yanfly’s Item Core
  2. Yanfly’s Item Durability

Alternatively, Yanfly has a complete pack for $30 that includes all scripts instead of the $10 for Item & Equip Scripts. Find that here

Once you have access to these, download them and in the next section we will set them up. If you’ve already done so, feel free to skip to the final section.

Installing & Activation

Once you have downloaded Yanfly’s Item Core & Item Durability scripts, we need to bring them into RPG Maker MV for use.

At the top of your game’s toolbar, we can find a quick shortcut to open our project folder:

Open Project Folder in RPG Maker MV
Our Game’s Project Folder

After we have our project folder open, navigate to the /js/plugins folder, which is where we will drop our Yanfly scripts

Yanfly’s X_ItemDurability script & ItemCore Script

Now we can close these folders out and go back to our game. Open the plugin manager (seen below)

Plugin Manager icon as seen in RPG Maker MV
Plugin Manager where we will be adding in the Item Core & Item Durability Scripts

To add in our script Yanfly’s Item Core, double-click in the first available open space. You will be greeted with the Plugin dialog box:

Empty Plugin Dialog Box

To add in the script, simply open the Name dropdown box and select “Yep_ItemCore”. The plugin will auto-fill.

Auto-populated Plugin

Verify that the Plugin Status is “ON” and click OK to activate!

Plugin Manager showing our newly added YEP_ItemCore

Repeat this process for the Item Durability script.

Quickly adding in the Durability Script

Now that we have added in and activated our scripts, in the next section we will add item durability to our character’s weapon.

Adding Equipment Durability

Per the script documentation, adding durability is as simple as using a Notetag. Notetags are little instructions written in the Notes section of the database. These tags will only be used if a script is specifically written to read Notetags. This is why we added in the ItemCore before the ItemDurability.

The Item Durability notetag is: <Durability: x> where X is equal to the amount of durability a piece of equipment has.

For the purpose of this tutorial, I want to create a weak sword that will break on its next use. In order to do this, all we need to do is add the notetag in the notes section of a new item:

A sword with the durability of 1 will break on its next use!

Test it in game and…

The sword breaks as expected!

Note that there are a lot of additional things that can be done now with equipment and if you have additional questions regarding the newly installed ItemCore and ItemDurability scripts, check out Yanfly’s extensive documentation on their website Yanfly.moe, or reach out to me here.

Good luck and happy game making!

--

--

Joe Vincent

I have been a hobbyist game developer for nearly two decades. I love burgers, programming, hiking and living life purposefully with my wife!