Skip to main content

Party

Temporary parties with invitations, a GUI menu, size limits and whole-party server warps.

Privatev0.2.0Social
RequiresTypeWriter0.9.0-beta-177 (BTC build)Quest (TypeWriter extension)GUI (TypeWriter extension)MySQL (TypeWriter extension)optionalRedis or Valkeyoptional

Built for the BornToCraft network. This extension is documented for reference and is not distributed.

Overview​

Party lets players form a short-lived group. The leader creates a party and invites players by name, and invited players accept with /party join <leader>. Quest, dungeon and HUD systems can then ask "who is in the same party as this player". A leader can also warp the whole party to another server of the network.

Parties are not saved to a database: they live in memory and are replicated to the other servers of the network through Redis. A member who disconnects stays in the party, so the party survives a server hop, and it ends only when members leave, are kicked, or the leader disbands. A restart of every server dissolves all parties.

The party menu is a GUI menu that you build in the web panel. Members are shown as player heads, and pending invitations as clickable heads.

Features​

  • Create, invite, join, leave, kick, disband — available as commands, TypeWriter actions and menu buttons.
  • Party menu — one entry with member and invitation screens, pagination and tabs.
  • Invitations — chat-based name entry, a join screen with a search filter, and 60 second expiry.
  • Size limits — a default maximum with higher limits for permissions such as typewriter.party.vip.
  • Warp to a server — the leader sends all members to another backend, wherever they are on the network.
  • Cross-server parties — membership, invitations and party chat messages reach every server of the group.
  • Story hooks — a fact tells whether the player is in a party.
  • Placeholders — leader, role, size, member names and member health for HUDs.
  • Integrations — other BTC extensions, such as coop islands and dungeons, create and read parties.

Installation​

  1. Install the GUI extension, which draws the menu, and the Quest extension, which Party declares as a dependency.
  2. Optional, for several servers: install the MySQL extension, enable Redis (or Valkey) and set the same redis.group-id and a unique redis.server-name on every server. Warping needs the proxy to handle the btc:bridge channel.
  3. Put the Party JAR in plugins/Typewriter/extensions/ and restart the server.

party.use is given to everyone by default and party.admin to operators.

Getting started​

Build a party menu and a size limit:

  1. In the TypeWriter web panel, open a page and add a Party Menu Config entry. Only its limits are used (see Configuration): set maxPartySize and optionally maxPartySizePermissions.
  2. Add a Party Menu entry. /party opens the first one it finds.
  3. Set inventoryTitle, inventoryRows and guiType, then build the layout in layoutPool and set mainLayoutId. See the GUI guides.
  4. Declare screens in views (for example members and join). List the member screen ids in memberListViewIds and the invitation screen id in joinListViewIds.
  5. Add items with a buttonType: PARTY_MEMBERS, PARTY_JOIN, PAGE_NAV, and the buttons that run commands (see Menus).
  6. Publish and run /party.

To start a party from a quest, use the Create Party action. To bring players together, use Invite Player with targetName, which accepts a placeholder, and Join Party with leaderName.

Dungeons and instances

Use Warp Party to Server with targetServer set to the backend name known to the proxy, for example dungeon-1. Only the leader can trigger it. Combine it with the In Party fact as a criteria to offer the warp only to players in a party.

How it works​

Every party change is sent to the other servers, which replace their copy. Invitations expire after 60 seconds, checked once a minute, so an invitation lasts between 60 and 120 seconds. When the leader leaves, the first remaining member becomes leader. A party with no member is removed.

Configuration​

The Party Menu Config entry is optional. It only holds the party size limits, through these fields:

  • maxPartySize — default maximum number of members. The default is 5.
  • maxPartySizePermissions — permission to maximum size. The leader's highest matching size applies. The defaults are typewriter.party.vip for 8 and typewriter.party.mvp for 12.

Without this entry there is no size limit. The party menu itself is not configured here, it comes from the Party Menu entry.

The Party Artifact is not read or written by the party service in this version, and you do not need to create one.

The Party Menu entry is a GUI menu with these party-specific behaviours.

Content panel. On a screen listed in memberListViewIds, each member is a player head showing role and online status. If you are the leader, left click on another member kicks them. On a screen listed in joinListViewIds, each pending invitation is the head of the inviting leader: left click joins, right click declines. The panel is placed with contentX (default 5), contentY, contentColumns (default 4) and contentRows (default 7).

Buttons. These buttonType values work out of the box:

buttonTypeClick
PARTY_MEMBERSOpen the members screen (party open members).
PARTY_JOINSwitch to the join view of the same menu.
PAGE_NAVLeft click forward, right click back; the name shows the page counter. Hidden when one page is enough.

These values attach no action. Configure the item yourself and give it commands: PARTY_INFO, PARTY_CREATE, PARTY_LEAVE, PARTY_DISBAND, PARTY_INVITE, PARTY_CLOSE, PARTY_ACCEPT_INVITE, PARTY_DECLINE_INVITE. For example, run party create, party leave or party disband on the matching items. An invite button needs a typed name: give it an input dialog whose onInputCommands runs party invite {input}.

Slot commands. Items can run party open [view], party page next|prev|<number>, party info, party create, party leave, party disband, party kick <name>, party invite <name>, party join <leader>, party declineinvite <leader> and party joinsearch <text>. They run as the player who clicked.

Language

Head lore and some admin messages are in French. The placeholder <party_role> returns the French words Chef, Moderateur and Membre. Use <party_role_raw> for the identifiers LEADER, MODERATOR and MEMBER.

Commands​

All commands need party.use. Alias: /p. The bare command opens the first Party Menu and prints nothing when none exists.

CommandDescription
/partyOpen the party menu.
/party createCreate a party and become its leader.
/party inviteClose the inventory and type the player's name in chat.
/party invite <player>Invite a player (leader only).
/party join <leader>Join the party of that leader, if invited.
/party accept <leader>Same as join.
/party leaveLeave your party.
/party kick <player>Kick a member (leader only).
/party disbandDisband the party (leader only).
/party infoPrint leader and members.
/party admin listList all active parties (requires party.admin).
/party admin info <player>Show the party of a player.
/party admin disband <player>Disband the party of a player. Its leader must be online.
/party admin kick <player>Remove a player from their party. The party leader must be online.

Permissions​

PermissionDefaultGrants
party.useEveryoneEvery /party command. Menu clicks run the same actions without checking it.
party.adminOperatorsThe /party admin commands.
typewriter.party.vip, typewriter.party.mvpNoneHigher party sizes, only when listed in maxPartySizePermissions of the configuration entry. These names are the defaults and can be changed.

Placeholders​

MiniPlaceholders tags for MiniMessage text, such as <party_leader>. Indexes start at 0.

PlaceholderReturns
<party_in_party>1 when the player is in a party, else 0.
<party_leader>Name of the leader.
<party_role>Chef, Moderateur or Membre.
<party_role_raw>LEADER, MODERATOR or MEMBER.
<party_size>Number of members.
<party_members>Number of members.
<party_members:index>Member name at that position.
<party_members_exclude:index>Member name at that position, without the viewer.
<party_list>Member names separated by a comma.
<party_member_name:index>Member name at that position.
<party_member_uuid:index>UUID of that member.
<party_member_health:index>Current health of that member when online on this server, else 0.0.
<party_member_health_max:index>Maximum health, 20.0 when unknown.
<party_member_health_percent:index>Health as a percentage.

Entries​

10 entries, generated from the extension source.

Actions7
Facts1
Artifacts1
Manifests1

Troubleshooting​

/party does nothing. No Party Menu entry is published. Subcommands such as /party create work without it.

"You do not have an invite to this party." The invitation expired after 60 to 120 seconds, or the leader's name was misspelled. Ask the leader to invite again, then use /party join <leader>.

"Party is full! Limit: N". The leader reached maxPartySize of the Party Menu Config. Raise it, or grant the leader a permission listed in maxPartySizePermissions. Without the configuration entry there is no limit.

Members on another server do not appear. Every server needs the same non-empty redis.group-id, a unique redis.server-name, and a connected Redis. Without a group-id nothing is broadcast.

The warp fails with "Cross-server transport is unavailable." Redis is not connected. Check the MySQL extension configuration. The targetServer must be the backend name known to the proxy, and the proxy must accept the btc:bridge channel.

Changes in the Party Menu Config (slots, buttons, messages) have no effect. Those fields belong to a former menu that is no longer registered. Use the Party Menu entry to design the menu.

The next chat message after /party invite is not shown. This is expected: the command without a name waits for one chat message and uses it as the player name, then invites that player. A wrong name just gives an error.

  • MySQL — Redis messaging and the proxy transport used for warps.
  • GUI — layouts and views used by the party menu.
  • Friend and Guild — the other social systems.
  • BTC Sky — coop islands put members in the same party.
  • Dungeon — dungeon instances use the party to group players.