A bukkit plugin.
Java
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/main
.gitignore
README.md
pom.xml

README.md

EconomySim

This is a [craft]bukkit/spigot plugin for simulating a Minecraft economy. It works by keeping track of the amount of items bought and sold to shops.

Algorithm

To simulate prices changing as a result of the market, while being completely agnostic of actual block values (which might vary from server-to-server), the price of items is based on their demand. The demand is calculated as totalBought - totalSold per item (a negative demand is possible). The price is calculated from this value. For the default equation parameters, the price vs. demand curve can be seen below. Notably, the price drops rapidly as people sell them, which generally is as desired: items like dirt are available in abundance. When items are more in demand than in supply, their prices increase rapidly.

Price Curve

Decay

To help numerical stability, especially in small economies, a decay on the transaction amounts is used. A configurable percentage of transaction amounts will be subtracted each day (simulated at a shorter time-interval). The decay percentages are settable separately for sell and buy transaction amounts. For example, take the sell transaction amount decay at 1%/day and the buy transaction amount decay at 10%/day. If at the start of the day the sell and buy amounts for an item are 1000 and 200 respectively, they will be 990 and 180 at the end of the day.

Citizens 2.0

EconomySim has built-in Citizens support. To use EconomySim with Citizens, give a Citizens NPC the EconomySim trait and then use the esSetShop-command on the NPC to set its shop.

Documentation

The Javadoc for EconomySim is available here.