TinyEconomyRenewed

TinyEconomyRenewed

Mod

A tiny economy system for your minecraft server (earn, buy and sell)

Server Adventure

305 downloads
6 followers
Follow Save
90% of ad revenue goes to creators. Go ad-free while supporting creators with Modrinth Plus. Subscribe today!

Tiny Economy Renewed

Description

The purpose of this project is basically to create a small economy system for a private modded server This mod requires a MariaDB database server. Since version 0.0.7, the mod require a mod called « MariaDBServerFabricMC » that will create and start a mariadb server. So you don't need to manually install a database server anymore. For older version: you can find at the bottom of the readme a link to a tutorial explaining how to install a MariaDB database server This is the default information for the database connection:

  • Port -> 3307
  • User -> root
  • Password -> Pa$$word

This settings can be modified in the following configuration file:

  • config/tinyeconomyrenewed/database-config.json

Earn money feature

Players can earn monney by doing the following things:

  • Accomplishing advancements
  • Killing entities
  • Mining blocks
  • Logging on the server (once per 24h)
  • Killing other players

The prices can be modified in the following configurations files:

  • config/tinyeconomyrenewed/advancement-reward-config.json
  • config/tinyeconomyrenewed/entity-killed-reward-config.json
  • config/tinyeconomyrenewed/mined-block-reward-config.json

Note: There is an internal system that prevents player from making too much money by killing or breaking blocks while afk

How does the money earn for mined blocks work ?

Each type of block has a configuration with a maximum value in blocks per minute and a base price. First of all, when a player starts mining, we calculate the number of blocks mined per minute in the last 5 minutes. Here is an example to explain. The player logs in, then begins to mine land. To know the price, we collect all the broken Dirt blocks during the last 5 minutes. In our example, 20 blocks of dirt have been mined in the last 5 minutes. We calculate the time between the last mined block and the first mined block that is not more than 5 minutes. Let's imagine that the first block was mined at 9:00 am exactly and that the last one was mined at 9:03 am. So it's been 3 minutes We can then calculate how many blocks of Dirt the player has mined per minute by doing one of these two calculations : if the elapsed time in minutes is smaller than or equal to 1 minedBlockPerMinute = TotalMinedBlockFor5LastMinute * elapsedTimePerMinute if the elapsed time in minute is greater than 1 minedBlockPerMinute = TotalMinedBlockFor5LastMinute / ElapsedTimeInMinutes

Here we have 20 / 3 which makes 6.66 blocks per minute Now you have to know that for the dirt block, its maximum value of BlocPerMinute is 200. This means that if the player exceeds 200 blocks per minute, he will not win anything. Here 6.66 is smaller than 200, so the calculation of the prize is done as follows difference = 200 - 6.66 = 193,34 percentage = 100 * 193,34 / 200 = 96,67 The price of a mined dirt block is set to $50 for the smallest average of blocks per minute. then as the player is at 6.66 blocks per minute, the price he will earn will be the 96,97 % of 50$. So he will win 48.335$. In fact, the more the player mines, the less money he earns

How does the money earn for entity killed work ?

It is the same as for the mined block Config file: config/tinyeconomyrenewed/entity-killed-reward-config.json

How does the money earn for advancement done work ?

Each advancement has a fixed value that will be given to the player when he has completed it Config file: config/tinyeconomyrenewed/advancement-reward-config.json

How does the earnings work when connecting to the server ?

Players will simply receive a fixed amount when they log in (once every 24 hours) Config file: config/tinyeconomyrenewed/earn-money-feature-config.json

Earning money when a player kills another player

Players can earn money by killing another player Config file: config/tinyeconomyrenewed/earn-money-by-killing-players-config.json

Shop Feature

Players can create shops to sell items to each other. A shop is represented by a barrel where there is a sign in front of it. On the first line (0) -> There is the name of the player who owns the shop. On the third line (2) -> There is a first number that indicate how many item a player can bought with on left click on the sign. Then there is a space followed by this two caracteres ->. And finally another space followed by the last number that indicate the price.

Here are some other things to note about the shops

  • Only the owner of a shop can break it
  • You can chose if a shop can be destroy by specific explosions (WITHER,TNT,ETC.) or all type of explosions. Config files: config/tinyeconomyrenewed/shop-config.json
  • The owner of his own shop can however destroy it with his own TNT
  • The hopper and minecart hopper placed under a shop does not work
  • Level permission 4 allow player to break the shop of another player
  • A player can look inside another player's shop, but can't take anything, put anything Important: for a shop to be valid, there must be only one type of item inside

Villager trade cost money feature

Trade with a villager requires a price. This feature can be usefull if for example you have a mod like InfinityVillagerTrading in your modded server. You like the fact that you can trade endlessly, but you also find it too balanced. Then you can ask for a cost to nerf this a bit The configuration file for this feature is located like below: config/tinyeconomyrenewed/villager-trade-costs-money-config.json

Money earned reward feature

You can set up award prizes. When a player reaches one of these prizes for the first time, he can earn experience and items (configurable). If the player is currently not logged in and has just earned money because another player bought items from his shop, he will receive the reward when he logs in again. The configuration file for this feature is located like below: config/tinyeconomyrenewed/money-earned-reward-config.json

Loss money dying feature

Player will loss an amount of money after dying The configuration file for this feature is located like below: config/tinyeconomyrenewed/loss-money-dying-config.json

Commands

Find below a list of available commands

  • UpdateMoneyFromDatabase Description: This command allow you to update the money of players to the running mod from the database. It's mostly useful for dev and debugging Permission level: 4

This mod is almost full server side. But you will need it on the client as weel for having some interesting small feature (like custom sounds) The latest version (1.0.8+1.19.3) require

Java: >= 17 Minecraft: >= 1.19.4 Fabric Loader: >= 0.14.19 Fabric API: >= 0.78.0+1.19.4 Fabric Language Kotlin: >= 1.9.3+kotlin.1.8.20 Silk >= 1.9.6 MariaDBServerFabricMC >= 0.0.3+1.19.4

If you download the mod from the Curseforge application, all dependencies will be downloaded automatically

Be careful, if you update the mod (please read the changelog), it is possible that the name or the content of the configuration files (json) has changed, which could make the server crash at startup. Always make a backup of the bettersnowgolem folder before updating !


Project members

AmibeSkyfy16

Owner

Details

Licensed MIT
Published 2 years ago
Updated 7 months ago