Description
Gallery
Changelog
Versions
Discarpet
A Carpet extension for discord bot functionality

This is an extension for fabric-carpet that adds parts of the Discord bot API as scarpet functions.
This allows you to code Discord bots that run within Minecraft, and interact with the Minecraft world.
Requires Carpet mod
All Versions
+ Add Version| Name | Game version | Platforms | Published | Downloads | Actions |
|---|---|---|---|---|---|
|
R
1.7.7
|
1mo ago | 1 | |||
|
R
1.7.6
|
4mo ago | 1 | |||
|
R
1.7.5
|
5mo ago | 1 | |||
|
R
1.7.4
|
7mo ago | 1 | |||
|
R
1.7.3
|
7mo ago | 1 | |||
|
R
1.7.2
|
9mo ago | 1 | |||
|
R
1.7.1
|
11mo ago | 1 | |||
|
R
1.7.0
|
11mo ago | 1 | |||
|
R
1.6.1
|
last yr. | 1 | |||
|
R
1.6.0
|
last yr. | 1 | |||
|
R
1.5.6
|
last yr. | 1 | |||
|
R
1.5.5
|
last yr. | 1 | |||
|
R
1.5.5
|
last yr. | 1 | |||
|
R
1.5.4
|
last yr. | 1 | |||
|
R
1.5.3
|
last yr. | 1 | |||
|
R
1.5.2
|
last yr. | 1 | |||
|
R
1.5.1
|
last yr. | 1 | |||
|
R
1.5.0
|
last yr. | 1 | |||
|
R
1.4.9
|
last yr. | 1 | |||
|
R
1.4.8
|
last yr. | 1 | |||
|
R
1.4.7
|
last yr. | 1 | |||
|
R
1.4.6
|
last yr. | 1 | |||
|
R
1.4.5
|
last yr. | 1 | |||
|
R
1.4.4
|
last yr. | 1 | |||
|
R
1.4.3
|
last yr. | 1 | |||
|
R
1.4.2
|
last yr. | 1 | |||
|
R
1.4.1
|
last yr. | 1 | |||
|
R
1.4.0
|
last yr. | 1 | |||
|
R
1.3.2
|
last yr. | 1 |
[1.7.7] 1.7.7
by replaceitem on Sep 17, 2026
Download
- Added
image_descriptionandthumbnail_descriptionto the embed schema - Added
file_typesoption for attachment slash command option and file upload component
[1.7.6] 1.7.6
by replaceitem on Jun 17, 2026
Download
- Updated to MC 26.2
[1.7.5] 1.7.5
by replaceitem on Jun 03, 2026
Download
- Reworked bot connection. Behavior may vary.
- Added
CONNECT_TIMEOUTconfig option for adjusting the bot connection timeout. Defaults to 10 seconds.
[1.7.4] 1.7.4
by replaceitem on Mar 29, 2026
Download
- Updated to MC 26.1
[1.7.3] 1.7.3
by replaceitem on Mar 29, 2026
Download
- Added support for checkbox, checkbox group and radio group components
- Updated modal examples with new components
[1.7.2] 1.7.2
by replaceitem on Jan 21, 2026
Download
- Fixed compatibility of
__on_system_messsageevent with other mods like better-fabric-console - Updated JDA version
[1.7.1] 1.7.1
by replaceitem on Dec 11, 2025
Download
- Updated to Minecraft 1.21.11
[1.7.0] 1.7.0
by replaceitem on Nov 27, 2025
Download
## Changes
### Components
The old syntax of defining an action row from an array is still supported for backward compatibility and convenience.
### Documentation
## Migrating
To migrate your scripts, the following is necessary:
- Updated to JDA 6.1.1. With that comes some breaking changes. See "Migrating" section below for necessary migrations
### Components
- Added new Label component type
- This replaces the use of Action rows in modals and the
labelproperty in text inputs - Action rows are now its own component type
- Instead of the
componentsin the message content schema being a list of lists of components,
action_row.The old syntax of defining an action row from an array is still supported for backward compatibility and convenience.
- The
labelfield of text inputs has been removed. Use a label component instead. - Added support for components V2 via
use_components_v2in message content - Added new components from components V2 (See docs for details)
- Separator
- Container
- Text display
- Section
- Thumbnail
- Media gallery
- File display
- File upload
### Documentation
- Message components example was split into seperate buttons and select menus example
- Added misc components example for component V2 components
- Added links to relevant examples to docs for functions and schemas
- Updated modal example with file upload and select menu
## Migrating
To migrate your scripts, the following is necessary:
- Converting action rows in modals to labels
- Check the updated modal example in the documentation
[1.6.1] 1.6.1
by replaceitem on Jun 23, 2025
Download
- Improved handling of error messages of api_exceptions based on JDA exceptions
[1.6.0] 1.6.0
by replaceitem on May 25, 2025
Download
Due to the [sunsetting of Javacord](https://github.com/user-attachments/assets/d5e8b4fe-60d1-4dcb-95e7-cf95933d1193),
this mod migrated to JDA, which meant that introducing breaking changes was inevitable,
so I chose to use this update to add more improvements that introduce breaking changes.
The naming convention of "parsables" in the documentation and changelogs have changed.
These map values used as function parameters are now referred to as "schemas" or "objects".
A "schema" is the format of the fields a parsable has,
while an "object" will be referred to as a map value following that schema.
## Breaking changes
The following changes may break existing scripts.
Make sure to update them to work with this new discarpet version.
### Event changes
Due to JDA having no built-in message caching, the following events were changed:
### Function changes
### Value changes
Additionally,
since subcommand groups and subcommands are no longer expressed as nested options,
but can be retrieved using
### Schema changes
### Type strings
ALL type strings are now returned in lowercase.
Additionally, the type fields of schemas are now all case-insensitive,
so you can interchangeably use upper or lower case strings everywhere.
Most values returned by the
####
The
Other changes:
#### Schema type strings
The
The
### Other breaking changes
## New features
### New file schema
Added a new
### New member value
Added
This can be used to retrieve data of a user specific to a server, like nicknames and roles.
In order to retrieve this value, the following has been added:
### Update channel function
this mod migrated to JDA, which meant that introducing breaking changes was inevitable,
so I chose to use this update to add more improvements that introduce breaking changes.
The naming convention of "parsables" in the documentation and changelogs have changed.
These map values used as function parameters are now referred to as "schemas" or "objects".
A "schema" is the format of the fields a parsable has,
while an "object" will be referred to as a map value following that schema.
## Breaking changes
The following changes may break existing scripts.
Make sure to update them to work with this new discarpet version.
### Event changes
Due to JDA having no built-in message caching, the following events were changed:
- The
__on_discord_message_editevent now no longer provides the previous message and whether it was actually edited - The
__on_discord_message_deletenow only gives the deleted message id and the channel object instead of the message object
### Function changes
- The channel or message for creating a thread is no longer provided in the schema (*previously "parsable"*), but as an argument to
dc_create_thread dc_reacthas been split todc_add_reaction(msg, emoji)anddc_remove_reaction(msg, emoji?, user?)dc_set_channel_topicwas removed in favor of the newdc_update_channel- Removed
dc_get_display_namein favor ofmember~'effective_name' - Removed
dc_get_timeoutin favor ofmember~'timeout_end' - Removed
dc_get_user_colorin favor ofmember~'color' - Removed
dc_get_user_rolesin favor ofmember~'roles' - Added
dc_update_presence()to replacedc_set_status()anddc_set_activity()
### Value changes
- The command value types are now all the same value type
dc_commandand can be distinguished withcommand~'type' - Removed
user~'discriminated_name, since discriminators are phased out by discord - Replaced
reaction~'message'withreaction~'message_id'since messages are not cached anymore slash_command_interaction~'arguments'andslash_command_interaction~'arguments_by_name'
Additionally,
slash_command_interaction_option~'options' was removed,since subcommand groups and subcommands are no longer expressed as nested options,
but can be retrieved using
interaction~'sub_command' or ~'sub_command_group'.- Replaced
~'is_subcommand_or_group'in slash command interaction option values with~'type'
### Schema changes
- Replaced
threadschemachannel_typewithis_private. - Changes to message content schema
- Renamed
reply_totoreferenced_messagesince it can now also used to forward messages - Added
message_reference_typewhich can be set toforwardto forward messages instead of replying - Made
contentfield optional for messages without content, like forwarded messages - The
file,url,bytes, andimagefields of the attachment schema have been moved to afileparsable - The
filefield is now no longer a system file path, but a scarpet resource path, just like it is used in scarpet'sread_file. byteshas been renamed tostring- The following fields of schemas now use the
fileschema (see above) thumbnailandimageinembediconinembed_authorandembed_footeravatarinwebhook_profileandwebhook_profile_updater
### Type strings
ALL type strings are now returned in lowercase.
Additionally, the type fields of schemas are now all case-insensitive,
so you can interchangeably use upper or lower case strings everywhere.
Most values returned by the
~'type' queries of values are now also different:####
~'type' stringsThe
types of a channel value have changed:SERVER_TEXT_CHANNEL->textSERVER_VOICE_CHANNEL->voiceSERVER_FORUM_CHANNEL->forumSERVER_STAGE_VOICE_CHANNEL->stageSERVER_NEWS_CHANNEL->newsSERVER_STORE_CHANNEL-> *removed*SERVER_PUBLIC_THREAD->guild_public_threadSERVER_PRIVATE_THREAD->guild_private_threadSERVER_NEWS_THREAD->guild_news_threadPRIVATE_CHANNEL->privateGROUP_CHANNEL->groupCHANNEL_CATEGORY->categorySERVER_DIRECTORY_CHANNEL-> *removed*- >
media
Other changes:
webhook~'type'CHANNEL_FOLLOWERchanged tofollowersticker~'type'SERVERchanged toguild
#### Schema type strings
The
component type in a component schema have partially different names now:BUTTON->buttonSELECT_MENU_STRING->string_selectSELECT_MENU_USER->user_selectSELECT_MENU_ROLE->role_selectSELECT_MENU_MENTIONABLE->mentionable_selectSELECT_MENU_CHANNEL->channel_selectTEXT_INPUT->text_input
The
style of the button schema is now no longer the color name, but the types name as discord refers to them:BLURPLE->primaryGREY->secondaryGREEN->successRED->dangerURL->link
### Other breaking changes
- Exception hierarchy and values have changed
## New features
- Added
slash_command_interaction~'subcommand'andslash_command_interaction~'subcommand_group' - Added
channel_typesto select menu schema - Added
mention_channels,mention_emojis,mention_slash_commands,mention_herefields to allowed mentions schema - Added
mention_replied_userto allowed mentions - Emoji fields in schemas now support many more string notations
- Added
dc_remove_reaction(msg, emoji?, user?) - Added
message~'stripped_content' - Added
message~'stickers' - Added
emoji~'type' - Added
reaction~'channel'andreaction~'server' - Added
respond_later_dataschema to third parameter ofdc_respond_interactionwhen using typerespond_laterto specify ephemeral.
### New file schema
Added a new
file schema for specifying the source of a file- It uses some of the same fields previously found in the
attachmentschema - The
filefield is now no longer a system file path, but a scarpet resource path, just like it is used in scarpet'sread_file. byteshas been renamed tostringbase64was added as a way to provide data for the file- This is now used for the following fields of schemas:
thumbnailandimageinembediconinembed_authorandembed_footeravatarinwebhook_profileandwebhook_profile_updater- The
file,url,bytesandimagefields of theattachmentfield have been replaced with a singlefilefield.
### New member value
Added
dc_member value type, referencing a user in a server.This can be used to retrieve data of a user specific to a server, like nicknames and roles.
In order to retrieve this value, the following has been added:
- Added
message~'member' - Added
message~'member' - Added
interaction~'member' - Added
role~'members' - Added
server~'members' - Added
channel~'position - Added
dc_member_from_user(user, server)function for retrieving a member from the user and server.
### Update channel function
- Added
dc_update_channel, replacingdc_set_channel_topic, allowing to update many options of channels. - Added
channel_updaterschema.
[1.5.6] 1.5.6
by replaceitem on Mar 31, 2025
Download
- Updated to 1.21.5
- New behaviour for errors while executing API requests.
true or false (sometimes null or a value)to indicate success or failure. Now those functions no longer return anything
(or only return a value) and instead throw custom discarpet exceptions that can be caught using
try().This affects the following functions and queries:
- These functions no longer return a boolean value to indicate success
dc_set_channel_topicdc_reactdc_set_nicknamedc_add_roledc_remove_roledc_set_namedc_delete- These functions will now throw an exception instead of returning null. When successful they will return a value:
dc_send_messagedc_send_webhookdc_create_webhookdc_update_webhookdc_create_threaddc_create_application_commanddc_get_global_application_commandsdc_user_from_iddc_message_from_iddc_webhook_from_iddc_webhook_from_url- These actions now properly handle errors and throw exceptions on failure:
attachment~'download'channel~'webhooks'server~'webhooks'server~'slash_commands'user~'private_channel'- Special cases:
dc_respond_interactioncan still returnnullwhen the response type doesn't create a message. In all other cases it will either throw an exception or return aMessage- Added events:
__on_discord_message(message, old_message, is_actual_edit)__on_discord_message_delete(message)__on_discord_server_member_join(server, user)__on_discord_server_member_leave(server, user)- Fully removed the deprecated function
dc_create_slash_command. Usedc_create_application_commandinstead - Improved reloading of bots
- Split
dc_timeoutintodc_get_timeoutanddc_set_timeout
[1.5.5] 1.5.5
by replaceitem on Nov 09, 2024
Download
- Fixed errors on Minecraft 1.21.3
[1.5.5] 1.5.5
by replaceitem on Apr 23, 2024
Download
- Update to Minecraft 1.20.5
[1.5.4] 1.5.4
by replaceitem on Dec 11, 2023
Download
- Updated to MC 1.20.4
[1.5.3] 1.5.3
by replaceitem on Nov 13, 2023
Download
- Added new sticker value type
- Added dc_sticker_from_id(stickerId)
- Added new query options:
message~'webhook_id'emoji~'id'server~'emojis'server~'stickers'message~'sticker_ids'- Added
stickersfield to message content parsable
[1.5.2] 1.5.2
by replaceitem on Nov 08, 2023
Download
- Added new properties to message values:
referenced_messagetypelinkflagscreation_timestampedit_timestampposition
[1.5.1] 1.5.1
by replaceitem on Sep 07, 2023
Download
- Fixed discarpet loading events too early, causing log spam with modded entities ([#42](https://github.com/replaceitem/carpet-discarpet/pull/42))
- Removed
__on_command_executedin favor of builtin__on_player_command - Server voice channels can now be used for sending messages into the buildin text-in-voice channel
- Added suppress_notifications to the message content parsable
[1.5.0] 1.5.0
by replaceitem on Jun 07, 2023
Download
- Updated to Minecraft 1.20
- Reloading bots will now no longer freeze the game
- Improved error handling of the /discarpet command
[1.4.9] 1.4.9
by replaceitem on Mar 20, 2023
Download
- Updated to Minecraft 1.19.4
[1.4.8] 1.4.8
by replaceitem on Feb 14, 2023
Download
- Updated to minecraft 1.19.3
- Added support for user, channel, mentionable and role select menus
- Added new
component_typeproperty to select menu interaction values for distinguishing between different select menus - Added
nsfwproperty to channel values - Changed docs to be more consistent and correct for interaction value types
[1.4.7] 1.4.7
by replaceitem on Oct 19, 2022
Download
- Fixed [#38](https://github.com/replaceitem/carpet-discarpet/issues/38)
- Changed the maven group to
net.replaceitem
[1.4.6] 1.4.6
by replaceitem on Aug 12, 2022
Download
- Added [
dc_create_threadfunction](https://replaceitem.github.io/carpet-discarpet/functions/create-thread/) - Added [
threadparsable](https://replaceitem.github.io/carpet-discarpet/parsables/thread/) - Improved error message in some cases for parsables
- Using new internal enum parser for parsables
[1.4.5] 1.4.5
by replaceitem on Jul 29, 2022
Download
- Updated to Minecraft 1.19.1
- Fixed webhook profile and webhook profile updater parsable throwing an error when not using an avatar
- The
textargument__on_system_messageis now a formatted text value, which allows for better parsing usingencode_json(text)
[1.4.4] 1.4.4
by replaceitem on Jul 27, 2022
Download
- Improved config loading by adding missing config entries on startup
- Fix errors when events trigger when the server is starting or stopping
- Bumped dependency versions (This fixes the server not fully terminating after the world saved)
[1.4.3] 1.4.3
by replaceitem on Jul 12, 2022
Download
### BREAKING CHANGES:
### Other changes:
### Revamped documentation
- Intents are no longer boolean values, but a list of strings instead (See Setup)
dc_get_global_slash_commandsgot renamed todc_get_global_application_commandsand now returns all types of commandsdc_create_slash_command()got renamed todc_create_application_command()and has an additionaltypeargument, and returns the application command value instead of a boolean nowslash_command~'id'now returns the interaction id, instead of the slash command id. Useslash_command~'command_id'instead- The string representation of all discord values is now no longer the type name, but a custom string
### Other changes:
- Added
message_context_menu_builderanduser_context_menu_builderparsable - Added
dc_message_context_menuanddc_user_context_menuvalues - Added
dc_message_context_menu_interactionanddc_user_context_menu_interactionvalues - Added
ephemeralandsuppress_embedsfields tomessage_contentparsable dc_create_application_commandnow works with message context menu and user context menu commands- Fixed modal parsable internally being called
embed - Internally, renamed
instantparsable totimestampto match docs
### Revamped documentation
- The docs have moved to https://replaceitem.github.io/carpet-discarpet/
- All functions, values, parsables, events and examples have their own page now
- Added internal parsable names to the docs
- Added documentation on
dc_get_global_application_commands()which was missing - Many many more changes and polishes to docs
[1.4.2] 1.4.2
by replaceitem on Jun 29, 2022
Download
- Added support for modals
- Added **Modal** parsable
- Added new component: **Text input** parsable
dc_respond_interactionnow supports responding with a modal usingRESPOND_MODALtype- Added
dc_modal_interactionvalue - Added
__on_discord_modal(interaction)event - New [modal example](https://github.com/replaceitem/carpet-discarpet/blob/master/docs/Examples.md#modals)
- Added
dc_set_namefunction for renaming channels, emojis, roles, servers and webhooks - Added
localeproperty to all interactions. Returns the language code likeen-US - Slash command interaction options now work with the
attachmentoption type for submitting attachments as a slash command argument (Updated the [slash command example](https://github.com/replaceitem/carpet-discarpet/blob/master/docs/Examples.md#slash-commands)) - The
reasonargument ondc_add_roleanddc_remove_roleis now optional - Added optional
reasonargument todc_set_nicknameanddc_delete - Added
dc_timeoutfunction
[1.4.1] 1.4.1
by replaceitem on Jun 17, 2022
Download
- Chat messages,
/sayand/memessages are now included in__on_system_message - Added
__on_command_executed(player, command)event
[1.4.0] 1.4.0
by replaceitem on Jun 15, 2022
Download
- Removed
__on_chat_messageevent due to it being in fabric-carpet now (__on_player_message). __on_system_messageno longer provides an entity, since it only triggers from non entity bound actions now. A lot has changed with this event, many things that previously did, may no longer trigger this
[1.3.2] 1.3.2
by replaceitem on Jun 15, 2022
Download
### First modrinth release
- Update 1.3.2.1:*
- Update 1.3.2.2:*