Better Faction v1.1.18
Better Faction is an add-on (script) for pvp faction server, it include some custom command in chat and allow to add home, warp, create faction and more, create custom display, private chat group, translated in different language. The pack Need to have API BETA Experimental feature checked. (keep in mind it's in development) have fun.
The mod work on xbox, ps4, w10 and pocket edition.
copyleft licence.
if you want to see all command and a better explanation fell free to join us on discord : https://discord.gg/rdBjc4yvRu
Join the discord if you have any question or for follow all update : https://discord.gg/rdBjc4yvRu
+help

command List :
do /tag @s add Admin
tips : when you need to enter a playerName use @
ADMIN COMMAND
Setting command : Alias : sethl, sethomelimit
+sethomelimit <number>
define the default home limit a player have when he join the map for the first time
+sethomelimit <playerName> <number>
define the home limit of a specific player
Alias : setml, setmemberlimit
+setmemberlimit <number>
define the default member limit a faction have when it will be created
+setmemberlimit <factionName> <number>
define the member limit of a specific faction.
Alias : setscm, setscmoney, setscoremoney
+setscoremoney <ScoreName>
define the default money scoreboard (synchronise btw script and scoreboard)
Alias : setpf, setprefix
+setprefix <prefix>
define the default prefix when you use command with the mod (NEVER ENTER a "/" !!!)
Alias : setcn, setcustomname
+setsn
switch btw on and off the custom name feature (Warning : with custom name you can't do command like always, here an example : /tag "mister art43" add Admin for example if i create a faction named "fac" so my name will change and the valid command would be /tag "§6-Fac- §rmister art43" add Admin
Alias : setfh, setfhome, setfactionhome
+setfh +setfh <factionName>
define if the faction are able to use faction home (default on false).
Alias : settpadelay, settd
+settd <number>
edit the delay before a tpa request expired (in second) (default on 60 seconds)
Player Command
Alias : sethome, sh
+sethome <homeName>
set a new home point at your current position (work in different dimension)
Alias : home, h
+home <homeName>
teleport to your home
Alias : delhome, dh
+delhome <homeName>
remove a home you have
Alias : listhome, homelist, lh
+listhome
list all home you have
Alias : pay
+pay
launch the pay ui
+pay <playerName>
send money to another player
Alias : balance, bank
+bank
show how many money you have.
Alias : tpa
+tpa <playerName>
ask for a player to teleport to him.
Alias : tpah, tpahere
+tpahere <playerName>
ask for a player to teleport him to you.
Alias : tpayes, tpaccept
+tpayes <playerName>
accept all tpa / tpahere request. note : tpa request expire after 60 sec (connected or not)
Alias : lang
+lang <yourLang>
change the langage of better faction note : supported langage : en, es, fr, id, vi, pl
Alias : c, chat
+chat all
go in the general chat
+chat f +chat faction
go in a private chat with your faction
+chat a +chat ally
go in a private chat with your faction and other faction you have relation with +f ally...
+chat <password>
go in a private chat with every player who put the same password

Alias : faction, f faction Command : Alias : create
+f create <factionName>
create a new faction.
Alias : quit, q
+f quit
leave the faction.
Alias : invite, invit, inv
+f invite <playerName> +f invite clear +f invite list
invite a player to join your faction
Case Sensitive
!!! ("mister art43" is not the same as "Mister Art43").
Alias : join, j
+f join <FactionName>
for joining a faction.
Alias : info, i
+f info +f info <factionName>
show information about your faction or a specific faction if you enter the name
Alias : sethome, sh
+f sethome
set the faction home (only leader can do that, only in overworld). (if the admin activate this option)
Alias : home, h
+f home
teleport you to the faction home (if the admin activate this option) (default coordinate are the location were the owner create the faction (only in overworld)).
Alias : k, kick
+f kick <playerName>
kick a player from the faction.
Alias : l, list
+f list +f list <factionName>
list all player + permission inside the faction.
Alias : b, bank
+f bank add <number> +f bank remove <number>
add or remove money to the faction bank (only leader and co leader can remove money).
Alias : promote
+f promote <playerName>
promote a player inside the faction (can only be used by the leader and co leader) [visitor > member > co leader > leader]
Alias : demote
+f demote <playerName>
demote a player inside the faction (can only be used by the leader and co leader) [visitor > member > co leader > leader]
Alias : warp, w Warp Command :
+w
launch the warp ui (is not the same if you are admin or not)
+w <WarpName>
teleport you to a warp
Alias : add
+w add <WarpName>
add a new warp at your current location
Alias : list
+w list
display all warp (IF THE PLAYER HAVE AN ACCESS)
Alias : close, open
+w close <warpName>
turn on or off a warp (so player won't be able to use it when it's off)
Alias : message, msg
+w msg
turn on or off the message.
Alias : message, msg
+w msg <warpName>
edit the message it display when you use this warp
Alias : delay
+w delay <warpName> <number>
set the delay (secondes) before a player can use the warp again
Alias : cmd, command, runcommand
+w cmd add "<warpName>" "<command>" +w cmd remove "<warpName>" "<command>" +w cmd clear "<warpName>" +w cmd list "<warpName>"
add commands which will be executed by the player when he will use the warp
Can Throw error !
Alias : access
+w access add allow <warpName> <tag> +w access remove allow <warpName> <tag> +w access add deny <warpName> <tag> +w access remove deny <warpName> <tag> +w access list
manage access on a warp with tag : allow tags : -if the player have the same tag so he is ALLOWED to use this warp deny tags : -if the player have the same tag he CAN'T use this warp (note: if there is no allow tag, everyone can use this warp, deny tag take priority on allow tag).
Admin command : note: to be admin you need to do
/tag @s add Admin
(It’s case sensitive so admin is not the same as Admin)
Alias : update
+update
if needed it will update the database (work for an upgrade or a downgrade version starting at the 1.0.14)
Alias : warn
+warn <playerName>
add a warn to a player
Alias : unwarn
+warn <playerName>
remove a warn to a player
Alias : inventory
+inventory "<playerName>"
show the inventory and the hotbar of a player (only work if the player is connected)
Alias : tp
+tp <playerName>
teleport you to the player (works with customName)
Alias : back
+back
teleport you to the place before a tp (any tp from better faction command)
Alias : admin
+admin add <password> "<playerName>" +admin remove <playerName> +admin list
push the player in the Admin database (the password need to be only character without space) work with +lock
Alias : lock
+lock
will lock the Admin database and will remove anyone who try to give itself the Admin tag and is not inside the Admin database it also avoid Admin player to be ban
Alias : unban
+unban <playerName>
unban the current player

Custom Chat : (ADMIN COMMAND)
Alias : role
+role add <roleName>
+role remove <roleName>
add or remove role displaying when you talk in the chat.

tags parameter : you can customise color of the player name and his message by giving him a tag :
/tag "mister art43" add colorName:§b /tag "mister art43" add colorMessage:§e
log tags : /tag @s add log
allow you to see some log from the script and more information on some commands when they are used.
/tag @s add chat_log
allow you to see any private discussion in the world adding money thanks to tags parameter :
/tag "<playerName>" add "money:<number>" /tag "<playerName>" add "setmoney:<number>"
/tag "mister art43" add "money:100"
-> will add 100 money to mister art43
/tag "mister art43" add "money:-100"
-> will remove 100 money to mister art43
/tag "mister art43" add "setmoney:100"
-> will set at 100 money for mister art43 ban tag
/tag "<playerName>" add ban
kick the player until you unban him /!\the money can overflow and go more than a scoreboard can do (2 147 483 647) (modifié)
Display Command : 🧱display-parser🧱 ➕extension➕ are recommended to consult to use it Alias : display (avaible on my discord)
+display add <title|actionbar> <tag> "<text>" +display remove <id> +display list
(+display list show the id of each display) show a custom "setdisplay" scoreboard for all player who have the tag note that you can switch between different tag to make multiple display !
don't forget "/tag add @s add Admin" for use admin command.
Join the discord if you have any question or for follow all update : https://discord.gg/rdBjc4yvRu
also, to upload the pack on realms you need to download the world, put the pack inside (don't forget to enable gametest framework) then upload the world with the pack inside.
Update 1.1.10 :
fix : display custom scoreboard wasn't detected by the new parser
add : display parser new param :
<version> -> the version of the script
<prefix> -> prefix you use (for exemple to say +help in the display <prefix>help)
<time> -> (in progress) will give time formated like this "HH:MM" -> "12:00" (is based on UTC 0)
<timeS> -> (in progress) like <time> but also give seconde at the end : "HH:MM:SS" -> "12:00:59"
<day> -> give the number of the day
<month> -> give the number of the month
<year> -> give the current year
fix : faction date creation was wrong
change : the data to save the date in the player and the faction is now a "custom_date" object
Update 1.1.11 :
fix : +pay
make the script crash when called
fix : +tpa / +tpahere / +tpayes
was delayed on the refreshTime frequency, so too fast refresh = no time for tpa
add : +set
this command is to edit global variable of the script, like home player, allow faction home, tpa delay, customName...
And can be applied to new AND old player now
add : +set -> customName :
Now you can see the player health and their current role if you enable it (by default on false)
improve : warp delay is way more faster than before
change : scoreboard money & warn actualization now depend on the "refreshTime" global variable (can be edited in +set)
change : faction separator is only two letter, and is now changing the Displayed name too
improve : db_player now load way more faster than before, (if cheap server does have issue pls let me know)
improve : player was checked 2 times in the tick loop (now it's only one)
improve : way to get player tag is way more faster than before
update 1.1.12 :
fix : the script was refreshing data faster than the scoreboard was able to execute -> player data was corrupted
fix : +set -> member limit -> crashed at the start
change : now faction use the same model as db_player to load the database
change : now db_player have 2 new methods :
- remove_to_update_player(player)
- add_to_update_player(player)
those two methods don't delete the player from the script, only from the scoreboard to update value, (it will be modified in script with the pointer).
improve : the faction player's was loaded 2 times in the tick loop (now it's only one)
add : in debug mod you now see the refreshTime of the script
Update 1.1.14 :
fix : +set -> allow faction Home
sometimes the button "Apply to all" wasn't working
add : +display -> add -> rule
will pop up a display with rule when the player join for the first time or when he do +rule
add : +display -> duplicate
allow you to duplicate an existing display and change his tag & type (actionBar or Title)
improve : when a +update is running, disable all non-Admin command to avoid any possible corruption
fix : +f -> join
didn't let you join the faction
change : display can now be both actionBar & title at the same times with different display (may reduce performance or crash if the player have too many tag or if there is too many display)
add : +set -> ruleCode
allow you to impose a code to be sure the player has read the rule (need to add <code> in the rule display)
this code can be randomly Generated, or defined by the Admin.
add : +rule
show the rule to the player (but will not ask the code this time)
Note : don't forget +update ! VERY IMPORTANT FOR THIS UPDATE !!!
Update 1.1.15
Beta Build : you may have unstable issue (but most of them are fixed)
Fix : +f join didn't update data in the database so when the server restarted the faction wasn't here.
Fix : +f home deleted the faction...
improve : +f quit and +f join are now async function to avoid any lag on cheap server
Big improve : the main loop is now way more fluid (can see it with /tag @s add debug)
add : now Money scoreboard and warn scoreboard can't be removed from the scoreboard objectives and will rebuild instantly when deleted
Big improve : now db_faction use the same architecture than db_player which is stable (avoid useless operation).
Update 1.1.16
fix : +f kick, join and invite didn't worked as espected
add : pvp and pve delay before use a tp command
add : you can edit pvp and pve delay with the command +set -> all delay
Update 1.1.18
Module update ! Now you can manage a group of command by switching on and off the module, here the list of them :
- home (+home, +sethome, +delhome)
- faction (all faction command)
- warp (all warp command)
- tpa (+tpahere, +tpa, +tpayes)
- chat (+chat) - lang (+lang)
- money (+balance, +pay)
- shop (Work in progress)
- rule (+rule)
you wan manage module with 2 command :
+module -> UI -> you can manage module for a specific player
+set -> UI -> Module Command -> you can manage module for all user or/and future user
improvement : the minimum recommended refreshTime for the script is now at 5 tick by default (was 10 before)
fix : online player were updated every Tick even if no modification was added. (so free server like aternos will run smoothly)
edit : +help now tell if the command is an UI and explain how to use them.
fix : when starting the game or reloading some server with a big player database (around 600 player) might have loose data, it's now fixed, and the recommended max user in a database is around 20 0000 players.
IMPORTANT : if you do this update don't forget to do "+update" after starting the world or you wouldn't be able to use any command !!!
Note : don't forget +update
see more on https://discord.gg/rdBjc4yvRu
Installation
when you start the mod for the first time verify you haveAPI BETAchecked from your setting, then do'/tag @s add Admin'.
To upload the pack on realms you need to download the world, put the pack inside (don't forget to enable gametest framework) then upload the world with the pack inside.
if you did have another version before do+update
if you did have a version lower than 1.1.4 do this :
/tag @s add Admin
/tag @s add log
/tag @s add debug
+manage resetALL
creator: https://www.twitter.com/Misterart43
updated