# KH Economy Datapack
- Video Explanation https://www.youtube.com/watch?v=8Eycf-jzFbY
- Updated video coming soon
- Looking for a server to join that wouldn't mind hosting my work. Would be willing to help them create speciallized datapacks/mods.
## Compatibility
- This is compatable with vanilla and ALL loaders(Forge, Fabric, etc.)
- Server side only(People do not need to download anything)
- Works with Geyser
- Works on single/multiplayer worlds
- Uses all vanilla mechanics
- Works with any shop mods/datapacks that use physical items
## Features
- Withdrawal/Deposit Emeralds or Diamonds (Commands below)
- Scoreboard currency
- Pay players nearby (Within 5 Blocks)
- Send Shares from the stock market (Within 5 Blocks)
- Mailbox System - Send money to any player anywhere even offline players (10 mailboxes, expandable)
- Stock Market - Invest in job performance with dynamic pricing
- Anti Cheat for every job
- Earn money through the skill trees get paid at sundown
- Admins have full control over economy(Treasurer Job)
- Events: Events are built in for all 12 skill trees(More coming, controlled by admins)
- Progression based(Paid more the more you play)
- Social Status(Peasant, Commoner, Noble, and Royal)
- All systems are smart and will calculate everything for you
- Very easy to use (All commands are near the bottom)
## Mailbox System
- Send money to players anywhere even players that are currently offline
- Create Mailbox: /trigger createMailbox
- Check Mail: /trigger checkMail
- Set the Mailbox to send money to: /trigger sendMail set
- Send Money: /trigger sendMoney set
- Claim Money: /trigger claimMail
- Currently 10 but planning to make 300. (will not increase lag)
## Stock Market
- Invest in stocks from any profession (Farmer, Miner, Rancher, Hunter, Fisher, Blacksmith, Lumber, Cook, Archer, Warrior)
- Dynamic Pricing: Stock prices update daily based on worker productivity (XP earned)
- Trading Impact: Buy/sell pressure creates minor price fluctuations throughout the day
- Daily Updates: Major price changes occur at sunset based on collective job performance
- Dynamic Pricing: Stock prices update daily based on worker productivity (XP earned)
- For every 1000 Shares bought the share incrases by 1%
- For every 1000 Shares sold the share decreases by 1%
- For [Skillname]XP it will be divided by 100 in the end then add to Share value
- If [Skillname]XP total is under 20XP but more than 1XP the stock reduces by 1%
## Skill Trees
### Farming
- Wheat 1 XP
- Potatoes 1 XP
- Carrots 1 XP
- Beetroot 1 XP
- Pumpkins 2 XP
- Melons 2 XP
- Levels: 500→600→700→800→900→1000→1200→1400→1800 XP
- Method: Break crops, collect items
### Mining
- Regular Ores: Coal/Copper (.1 XP), Iron/Redstone/Lapis/Gold (1 XP), Diamond/Emerald (4 XP)
- Deepslate Bonus: Coal/Copper (.2 XP), Iron/Redstone/Lapis/Gold (2 XP), Diamond/Emerald (6 XP)
- Nether: Gold (1 XP), Quartz (.5 XP), (NEW!)Ancient Debris (10XP)
- Levels: 200→300→400→500→600→700→700→800→900 XP
- Method: Break ores, collect items
### Ranching
- Animals: All farm animals give 1 XP for breeding, 1 XP + payment for meat/egg collection
- Special: Rabbit Foot (20 XP), Wool (3 pieces = 1 payment), Eggs (no reward yet)
- Levels: 100→200→300→400→500→600→700→800→900 XP
- Anti-Exploit: 10-second cooldown after killing 2+ animals within 1 second
- Method: Kill animals, collect items, breed animals, shear sheep
### Fishing
- Fish: Cod/Salmon (1 XP), Pufferfish (2 XP), Tropical Fish (5 XP)
- Levels: 50→100→150→200→250→300→350→400→450 XP
- Method: Use fishing rod, catch fish with active rod
### Archer
- Weak Mobs(zombie, skeleton, spider, cave_spider, creeper, husk, stray, drowned, silverfish, endermite, magma_cube, zombified_piglin) 1XP
- Medium Mobs: (witch, phantom, blaze, ghast, piglin, hoglin, shulker, guardian) 3XP
- Strong Mobs: (enderman, wither_skeleton, piglin_brute, zoglin, pillager, vindicator, ravager) 6XP
- Semi-Boss Mobs: (evoker, vex, elder_guardian) 10XP
- Boss Mobs: (wither, ender_dragon, warden) 50XP
- Levels: 50→100→150→200→300→400→500→600→700 XP
- Method:Kill Mobs with Ranged weapon
### Warrior
- Weak Mobs(zombie, skeleton, spider, cave_spider, creeper, husk, stray, drowned, silverfish, endermite, magma_cube, zombified_piglin) 1XP
- Medium Mobs: (witch, phantom, blaze, ghast, piglin, hoglin, shulker, guardian) 3XP
- Strong Mobs: (enderman, wither_skeleton, piglin_brute, zoglin, pillager, vindicator, ravager) 6XP
- Semi-Boss Mobs: (evoker, vex, elder_guardian) 10XP
- Boss Mobs: (wither, ender_dragon, warden) 50XP
- Levels: 50→100→150→200→300→400→500→600→700 XP
- Method:Kill Mobs with Melee weapon
### Hunter
- kill Small game (Rabbit, Bee, Bat, Frog, Tadpole, and allay) 1XP
- kill Medium game (Fox, Ocelot, Parrot, Turtle, Axolotl, Armadillo, Squid, or Glow Squid) 2XP
- kill Large game (Wolf, Polar Bear, Panda, or Strider) 3XP
- Levels: 50→100→150→200→300→400→500→600→700 XP
- Method:Kill Mobs
### Blacksmith
- Equipment: Iron (1 XP), Gold (2 XP), Diamond (3 XP), Netherite (4 XP)
- Items: Helmet, Chestplate, Leggings, Boots, Sword, Pickaxe, Axe, Shovel, Hoe
- Levels: 20→25→30→35→40→45→50→55→60 XP
- Bonus: Grants Minecraft XP (earned XP × level × 2)
- Method: Craft at crafting table
### Lumber
- No longer need to craft the planks.
- Just breaking the logs will get you paid
- Levels: 100→150→200→250→300→350→400→450→500 XP
- Method: Break logs, craft planks
### Cooking
- Simple Foods (1 XP): Bread, cooked meats, baked potato, pumpkin pie, fermented spider eye
- Complex Foods (2 XP): Cookies, soups, honey bottle, mushroom stew, suspicious stew
- Advanced Foods (3 XP): Golden carrot, cake, rabbit stew, glistering melon
- Master Foods (4 XP): Golden apple
- Levels: 200→250→300→350→400→450→500→550→600 XP
- Payment: Level × 2 base rate × items crafted
- Method: Craft at crafting table
### Enchanting (Will expand depth soon)
- Enchant items for rewards
### Alchemy (Will expand depth soon)
- Brew potions for rewards
## Admin Appointed Jobs
### Treasurer Job
- Special administrative role for server management.
- Salary: $100 × level daily (1 XP per day, levels at 10/12/14/16/18/20/22/24/26 XP)
- Appointment (Op required):
- /trigger setTreasurer set 1 - Make nearest player treasurer
- /trigger removeTreasurer set 1 - Remove treasurer role
- /function economy:jobs/treasurer/make_me_treasurer - Make yourself treasurer
##### Job Balance Control (1-1000%, 100 = default):
- /trigger setFarmerMult set
- /trigger setMinerMult set
- /trigger setHunterMult set
- /trigger setCookMult set
- /trigger setLumberMult set
- /trigger setFisherMult set
- /trigger setRancherMult set
- /trigger setBlacksmithMult set
#### Tax Control:
- /trigger setTaxRate set (1-99%, default 5%)
#### Banking System
- Convert between digital money and physical items.
- /trigger withdrawEmeralds set - Emeralds ($20 each)
- /trigger withdrawDiamonds set - Diamonds ($100 each)
Deposit:
- /trigger depositEmeralds set - Emeralds ($20 each)
- /trigger depositDiamonds set - Diamonds ($100 each)
#### Events
- Events are controlled by the treasurer(admin)
- 1 Event for all 12 Skill trees
- Treasurer sets the length of in-game days
- Treasurer sets the XP gain multiplier
- Treasurer sets the Payment gain multiplier
- Treasurer can start the event or stop
- /trigger eventDaysDuration set <1-14>
- /trigger eventMoneyMultiplier set <0-1000> (100 is default, percentage based)
- /trigger eventXPMultiplier set <0-1000>
- /trigger event[skillname] (to start the event)
- /trigger eventCancel
- How to Use: Set eventDaysDuration and eventMoneyMultiplier, (and eventXPMultiplier optional) then start the event /trigger event[skillname](like Farming). Thats it, now wait for the next payment and right after it will notify everyone also it will notify each day on how many days are left.
### City Bank Management:
- /function economy:banking/check_city_bank - Check city funds
- /trigger spendCity set - Spend city money
- /trigger depositCity set - Deposit to city bank
### Social Ranks
- Advance based on total money earned:
- Peasant (White) - Starting rank
- Commoner (Green) - $50,000
- Noble (Yellow) - $200,000
- Royal (Red) - $500,000
### Realtor (requires Open Parties mod)
- /trigger setPrice
- /trigger sellChunk
## Player Commands
#### Base Commands
- /trigger pay set (sends to the nearest player 5 blocks)
- /trigger levelCheck - Check skill levels
- /trigger WithdrawDiamonds set
- /trigger WithdrawEmeralds set
- /trigger DepositDiamonds set
- /trigger DepositEmeralds set
#### Stock Commands
- /trigger buy[skillname]Stock set
- /trigger sell[skillname]Stock set
- /trigger give[skillname]Stock set (sends to the nearest player 5 blocks)
- /trigger checkMyShares (Tells you what shares you have and how much then adds their value)
- /trigger checkMarketShares (Tells all current Share values)
#### Mailbox Commands
- /trigger checkMail
- /trigger claimMail
- /trigger sendMail set
- /trigger sendMoney set (Need to have mailbox set first with /trigger sendMail)
## Additional Information
### Anti Cheat System
- Opening containers, Placing blocks, Picking up items that are dropped by any player will reset specific item objectives preventing rewards
- Do not get paid unless you do the work(Auto farms will not get you paid)
- Killing multiple enemies too fast will stop all progress for a short time to nerf Mob farms from paying the players(Makes mob farms pretty much useless for rewards but is smart and will not effect players running about.)
- All payment systems know and check how much you have vs what you are trying to purchase
### Payment System
- When: Automatic at sunset daily
- Formula: Level × work completed = payment
- Requirement: Must break/kill source AND collect items
- Tax: 5% automatically deducted for city bank
- Anti-Exploit: Prevents mob farms and item duplication abuse
### Installation
- Place datapack in world/datapacks folder. Admin uninstall: /function economy:uninstall
### Uninstall
- Delete the core folder inside the datapack (located inside kheconomy.datapack/data/economy/function)
- /reload in your game (when you do this after removing the core the game will not set new objectives)
- /function economy:uninstall (This uninstalls everything from your world)
- Delete the datapack (kheconomy.datapack)
### Future Plans
- Keep the game running the same or smoother while adding features below.
- Add Lottery Feature
- Add Betting Feature
- Add Stock Exchange(make it resemble midevil)
- Increase City bank features
- Grant players real in-game XP and let the admins regulate the amount or turn off
- Add Skill Trees (Artisan, Smelting, Tamer, Enchanting and Alchemy)
- Add Coin Flip
- Make mini game for gambling