7. Inflation System - Tylwen/ShopGUIPlus-DynaShop GitHub Wiki

The plugin includes a sophisticated inflation system that simulates a realistic economy with changing prices over time. The inflation rate is affected by several factors including time, transaction volume, and total money in the economy.

Configuration

# Inflation system configuration
inflation:
  enabled: false
  base-rate: 0.5 # Base inflation rate (% per day)
  transaction-multiplier: 0.001 # Inflation factor based on transactions (% per transaction)
  money-threshold: 1000000 # Money mass threshold
  money-rate: 0.1 # Inflation rate based on money mass (% per million above threshold)
  deflation-rate: 0.05 # Automatic deflation rate (% per day)
  update-interval: 24 # Inflation update interval (in hours)
  max-factor: 5.0 # Maximum inflation factor
  
  # Specific inflation rates by category
  categories:
    food: 0.3 # Food items inflate more slowly
    minerals: 0.8 # Minerals inflate more quickly
    rare_items: 1.2 # Rare items inflate even more quickly
  
  # Specific inflation rates by item (format: shopID:itemID)
  items:
    resource:diamond: 1.5 # Diamonds inflate very quickly
    farm:wheat: 0.2 # Wheat inflates very slowly

How it works

  1. The plugin calculates an inflation factor based on several components:

    • Time-based inflation: Prices naturally increase over time.
    • Transaction-based inflation: More transactions lead to higher inflation.
    • Money mass inflation: When the total money in the economy exceeds a threshold, prices increase.
    • Automatic deflation: A small deflation counterbalances inflation to stabilize prices in the long run.
  2. Different item categories or specific items can have different inflation rates.

  3. The inflation factor is applied to all prices in the shop (buy and sell).

  4. The system updates the inflation factor periodically (defined by update-interval).

Commands

  • /dynashop inflation info - Display current inflation information
  • /dynashop inflation enable - Enable the inflation system
  • /dynashop inflation disable - Disable the inflation system
  • /dynashop inflation reset - Reset the inflation factor to 1.0
  • /dynashop inflation update - Force an immediate inflation update

Setting up item categories

To categorize items for inflation purposes, add a category property to your item or shop:

myshop:
  name: "My Shop"
  # Optional shop-wide category (all items inherit this)
  category: "general"
  items:
    bread:
      type: item
      # Item-specific category (overrides shop category)
      category: "food"
      item:
        material: BREAD
        quantity: 1
      typeDynaShop: DYNAMIC
      buyPrice: 10

When the inflation system calculates prices, it will:

  1. Check if the item has a specific inflation rate in the items section.
  2. If not, check if the item's category has a specific rate in the categories section.
  3. If not, use the base inflation rate.

Example

If you have bread in the "food" category with a 0.3% inflation rate, and the base rate is 0.5%, bread prices will increase more slowly than other items.


⚠️ **GitHub.com Fallback** ⚠️