Hey there. I’ve been asked to do something for Forge (as opposed to Bukkit) that deals with PvP servers and their needs.
So I made a factions mod. :)
Check it out:
This mod requires Forge.
This adds various items to start a faction, claim territory in the name of that faction and then have a go at other player’s territories.
Claimed territories contain basic building protection. That is, anyone not part of your faction cannot place or break blocks in it.
Killing you, however, blowing things up remotely, rummaging through your chest or trampling your crops and such is not prevented.
By DarkWolf Gaming, showing off Build 5 for 1.7.10
New Faction Deed
This is the start. This item cannot be crafted. Instead it has to be made available by a server op. (The item is in the creative menu under Tools.)
With this you can start a new faction in an unoccupied chunk, declaring yourself the faction leader and claiming that chunk as your own.
Every faction needs at least one chunk to their name, or they will be disbanded.
Only members of your faction can edit that chunk now, assuming the protection is up. (I’ll get to that further down.)
This is the next step. This thing can only be crafted by a faction leader. With each order a new chunk can be claimed for your territory.
The claimed chunk has to be adjacent to your existing territory.
This is also where the hostile intentions come through. You can try to lay claim to someone else’s territory, starting a hostile takeover. This will by default take 90 seconds (configurable) of continuous control attempts, during which all members of the enemy faction will be informed about this attempt and where it’s happening.
Once the enemy’s control strength of that territory has been depleted that chunk will return to neutral and can be claimed as normal.
If a faction has no chunks left under their control it will be disbanded and their valuables will be dropped in the form of Payment Orders at either the leader’s position (if available) or at some member’s position.
Chunk control strength regenerates in regular intervals (one ingame day by default) by a set amount (+15 strength by default) up to its maximum.
By default territories cannot be attacked without at least one member of that faction being online. (Amount and requirement is configurable.)
The claim order additionally also informs you about whose chunk you’re currently standing in and what the control strength of that chunk looks like (via its durability bar).
The third step. Each chunk under a faction’s control requires upkeep in regular intervals (by default once per ingame day for 1 valuable per chunk). The Payment Order can only be crafted by the faction leader and only they can use it to add valuables to the faction vault. However, anyone else can add valuables to the order itself by crafting it with either emeralds, diamonds or gold ingots. Blocks of all three types are also fine.
If the upkeep payment fails (eg, you don’t have enough valuables in the vault) chunk protection will be disabled for this territory and everyone else can lay claim to these chunks or build/mine in them without opposition until the next upkeep payment interval succeeds.
Player ID Card
The fourth step. The Player ID Card us used to deal with faction members. Anyone can craft these and then use them to sign ’em.
Hand this card to a faction leader so they can use it to add you to their faction.
If you’re the faction leader: Keep the card safe, because you’ll need it to remove this player from your faction later.
The card is also used to leave the faction you are currently in. (If you don’t have it anymore just make a new one as a member, sign it and crouch-use it if you want to leave.)
If the leader leaves a faction that faction will be disbanded and their territory claims removed. All valuables left in the faction vault will be spilled at the leader position in the form of Payment Orders.
Faction Name Order
An optional item. This thing can only be crafted by a faction leader and is used to rename the faction.
Make sure to hammer a name into it on an anvil first.
Another optional item. This card is only usable in creative mode and cannot be crafted. When used it gives an overview of all existing factions, their chunks, valuables and members. Additionally it can be crouch-used to enable or disable chunk protection for any given faction until the next upkeep payment check.
An item, used when change is required. A leader can craft and sign this deed and then hand it to another player to transfer leadership of their faction to them. They themselves will remain regular faction members.
A charter of your group. It displays everything to know about your faction, once this ledger has been crafted and signed by a leader.
Beware: anyone can read the ledger.
This order can be crafted and set by leaders only and then handed out to faction members. It will instantly return them to the set point.
The return point must be in your territory when set.
This map has been modified to display all faction territory within its range. It can be crafted by anyone, but requires claim orders to make.
- Territorial Dealings Build 12 for 1.7.10 (from Curse)
- Territorial Dealings Build 16 for 1.9 (from Curse)
- Territorial Dealings Build 17 for 1.10.* (from Curse)
Using this mod in modpacks is granted by default, assuming the usual crediting policies. (Name drop and link.)
I do like hearing about packs that use it, so drop me a line when you do so. :)
- Build 5 – Initial Release
- Build 6
– Save, refresh and upkeep ticks should now persist across restarts
– Adjusted the Player ID Card description slightly. (To indicate that leaders can both add AND remove players to/from their faction with this.)
- Build 7
– Fixed the Renaming Order not being consumed on use.
– Fixed the chunk protection not being enabled by default on faction creation. (It would kick in after the first upkeep payment.)
– Added debug output for faction renaming, if that is enabled.
– Did some code cleanup and refactoring here and there.
– Added the Overview Card, a creative mode item that gives that player an overview over all factions and their chunks, valuables and members.
-> That card can also be used to disable/enable chunk protection of a faction until the next upkeep payment check.
- Build 8
– Added some more console output when debug mode is enabled
– The Player ID Card should now no longer have a durability bar. (No point in having one.)
- Build 9
– Fixed players not actually being recognized as unique. Turns out I had to use player.getGameProfile().getId() instead of player.getUniqueID(). Hrm.
– Additionally I accidentally made two variables static, causing everyone to pay into the same vault. That is fixed as well.
– Also fixed another payment order calculation bug that would not pay in enough.
– Added protection against non-faction members interacting with things in claimed territory. (Also added a config option to turn that off if you so desire.)
- Build 10
– Fixed gold blocks not adding their value to payment orders
– Did a medium sized code overhaul to simplify things and make it faster. The downside is that existing faction data won’t be restored. Clean slate. Prepare accordingly. :S
- Build 11
– Did some more internal code changes for cleanliness.
– Hopefully improved how Leader-only recipes are being handled. Now they shouldn’t even show up in the output anymore if you’re not the leader of a faction
– Added the Inheritance Deed, used to transfer leadership of a faction to someone else.
– Added the Faction Ledger, used to display information about a specific faction.
– Added the Return Order, used to immediately return to a leader-set position
- Build 12
– Adjusted the block interaction protection slightly. Now it also monitors left clicks.
– Added the Territory Map, to display claimed chunks on. Unfortunately it can’t be displayed in item frames, due to the way MC is coded.
(The item frame renderer compares against the map item specifically instead of an instance of it or isMap().)
- Build 13
– Updated to 1.9
– Change: Not sending any chat messages on payday if the upkeep cost is set to 0. (Since nothing gets deducted.)
- Build 14
– Fixed client-side model loading happening on server side (Doesn’t really work, now does it?)
- Build 15
– Did some minor adjustments, to be compatible with Forge build 1907.
– Fixed client side chat formatting being called on server side
– Did another minor adjustment, so save and upkeep don’t tick faster than they should. Let’s hope that works!
- Build 15b
– Some more adjustments to the whole chat formatting thing. Looks like I missed a few calls.
- Build 16
– Minor fix: Tried to cancel an event that cannot be cancelled. That should be fixed now. (But the function itself is still a hackish workaround. Still pondering how to improve upon that.)
- Build 17
– Updated to 1.10.* and made some preparations for an internal overhaul.
- pre1. Get the latest Forge Installer
- pre2. Use said Installer, it will guide you through. Then select the Forge profile in the launcher
- pre3. Let the game run once, so it can set itself up properly. (make sure to quit the game afterwards)
- 1. Get the latest Territorial Dealings file. Then add the zip/jar unaltered to the mods folder, which can by default be found under “C:\Users\YOURUSERNAME\AppData\Roaming\.minecraft\mods”
- 2. Start the game, yo. You’re good to go.