RedPockets

A fully-featured Minecraft red envelope plugin that supports both coin red envelopes and item red envelopes.

27

Quick challenge

How far can you run before the mobs catch you?

RedPockets

RedPockets - Minecraft Red Packet Plugin

A feature-rich Minecraft red packet plugin that supports both currency red packets and item red packets.

Requirements

- Minecraft 1.21+ - Java 17+ - Spigot/Paper/Folia server - Vault (optional, for currency red packet feature) - Dependencies: Dependencies

Languages Supported:

Chinese, English

The language files are located in the resources directory

Features

- Economy System: Supports both random distribution and equal distribution modes - Economy System: Players can put in items for others to draw randomly - Economy System: Full graphical interface operation, easy to use - Economy System: Real-time broadcasts for sending and grabbing red packets - Economy System: Built-in Chinese and English language packs - Economy System: Supports MySQL and SQLite databases - Economy System: Compatible with mainstream economy plugins (Vault)

Installation

1. Download the latest version of RedPockets.jar 2. Place the plugin into your server's `plugins` folder 3. Restart the server or load the plugin 4. Configure the `config.yml` file (optional) 5. Restart the server to apply configurations

Configuration

Database

```yaml database:

Database type: mysql or sqlite

type: sqlite

MySQL configuration (only needed when type is mysql)

mysql: host: localhost port: 3306 database: redpockets username: root password: password ```

Red Packet Settings

```yaml redpocket:

Red packet expiration time (seconds), 0 means never expire

expire-time: 3600

Maximum amount for currency red packets

max-amount: 100000.0

Maximum number of red packets

max-count: 100 ```

Commands

Player Commands

| Command | Description | |---------|-------------| | `/redpocket` | Open the red packet creation GUI | | `/redpocket create` | Create a red packet (opens GUI) | | `/grab <RedPacketID>` | Grab a specific red packet | | `/redpocket preview <RedPacketID>` | Preview item red packet contents |

Admin Commands

| Command | Description | |---------|-------------| | `/redpocketadmin delete <RedPacketID>` | Delete a specific red packet | | `/redpocketadmin reload` | Reload plugin configuration |

Permissions

| Permission Node | Description | Default | |-----------------|-------------|---------| | `redpockets.use` | Use red packet features | OP | | `redpockets.create` | Create red packets | OP | | `redpockets.grab` | Grab red packets | OP | | `redpockets.admin` | Admin commands | OP |

Usage

Creating Currency Red Packets

1. Type `/redpocket` to open the main interface 2. Click on the "Currency Red Packet" icon 3. Set the total amount and quantity 4. Choose distribution method (random/equal) 5. Click "Confirm Send"

Creating Item Red Packets

1. Type `/redpocket` to open the main interface 2. Click on the "Item Red Packet" icon 3. Click "Edit Items" to open the editing interface 4. Drag items into the editing area 5. Return to the main interface and click "Confirm Send"

Grabbing Red Packets

- Click on the red packet link in the chat - Or type `/grab <RedPacketID>`

Support

For issues or suggestions, please contact the plugin author.

License

This project is open-sourced under the GPL-3.0 License.

User Guide

Detailed instructions on how to use all features of the RedPockets plugin.

Quick Start

Basic Commands

``` /redpocket - Open the main red packet interface /grab <RedPacketID> - Grab a red packet ```

Your First Red Packet

1. Type `/redpocket` in-game 2. In the GUI that appears, select either "Currency Red Packet" or "Item Red Packet" 3. Follow the prompts to set parameters 4. Click "Confirm Send"

Currency Red Packets

Overview

Currency red packets are based on in-game currency. Players receive corresponding currency after grabbing them.

Creation Steps

1. Open Creation Interface ``` /redpocket ``` Click on the "Currency Red Packet" icon

2. Set Total Amount - Click the "Total Amount" item - Enter the amount in chat (e.g., `100`) - Enter `cancel` to cancel

3. Set Quantity - Click the "Quantity" item - Enter the quantity in chat (e.g., `10`) - The quantity indicates how many people can grab the red packet

4. Equal Distribution - Equal Distribution: Each person gets a random amount, with a "Lucky Draw" possible - Equal Distribution: Everyone gets the same amount

5. Set Note (Optional) - Click the "Set Note" item - Enter the note information in chat

6. Confirm Sending - Check if settings are correct - Click "Confirm Send" - The red packet will be sent to all online players

Distribution Methods

Random Distribution

- The system randomly allocates amounts based on total amount and quantity - Each person receives a different amount - The person who grabs the most will be shown as "Lucky Draw" after the red packet is fully claimed - Suitable for adding fun and interactivity

Equal Distribution

- Total amount is divided equally among all recipients - Everyone receives the same amount - Suitable for fair distribution scenarios

Item Red Packets

Overview

Item red packets allow senders to place items for other players to randomly draw. It's a great way to give gifts to friends!

Creation Steps

1. Open Creation Interface ``` /redpocket ``` Click on the "Item Red Packet" icon

2. Edit Items - Click the "Edit Items" icon - Open the item editing interface (54 slots) - Drag items you want to send into the editing area - You can place multiple items, one item per slot - Items can be stacked

3. Return to Main Interface - Closing the edit interface saves automatically - Return to the creation interface

4. Confirm Sending - Check the item quantity - Click "Confirm Send" - The red packet will be sent to all online players

Features

- Expiry Return: Players randomly receive one of the items - Expiry Return: Each item can only be grabbed once - Expiry Return: Items are automatically locked after sending and cannot be modified - Expiry Return: Unclaimed items are automatically returned when the red packet expires

Important Notes

- Ensure items have been placed in the editing area - Confirm item settings before sending - Items will be automatically returned when the red packet expires

Grabbing Red Packets

Method 1: Click Chat Link

When someone sends a red packet, it will appear in the chat: ``` Player xxx sent 10 red packets worth 100 coins each, [Click here to grab] ```

Simply click on the green "[Click here to grab]" text to grab the red packet.

Method 2: Use Command

``` /grab <RedPacketID> ```

You need to know the red packet ID to grab it.

Viewing Red Packet ID

Click on the "type" text in the chat to view the red packet ID.

Preview Feature

Item Red Packet Preview

In the item red packet broadcast message, click on the "Item Red Packet" text to preview the red packet contents:

``` Player xxx sent an Item Red Packet containing 5 items, [Click to view] ```

The preview feature allows you to see what items are in the red packet, but you cannot take items from it.

Preview Notes

- The preview interface is read-only - You cannot take items from the preview - Preview data is stored in memory - The preview automatically disappears when the red packet expires or is fully claimed

FAQ

Q: What should I do if I get an "insufficient balance" prompt when grabbing a red packet?

A: Currency red packets require an economy system. Please ensure: 1. Vault plugin is installed 2. An economy plugin (like Essentials) is installed 3. Server economy features are enabled

Q: Where do items go when a red packet expires?

A: When item red packets expire: 1. Unclaimed items are automatically returned to the sender 2. You can view remaining items through the item editing interface 3. Reopen the item editing interface to see the returned items

Q: How can I modify a sent red packet?

A: Sent red packets cannot be modified: - Currency red packets: Amount and quantity are fixed after sending - Item red packets: Items are automatically locked after sending

Q: Why is the edit interface still read-only even after all items in an item red packet have been claimed?

A: This might be a bug. Please try: 1. Waiting a few seconds for it to refresh 2. Reopening the edit interface 3. Contacting an administrator if the issue persists

Q: Can I see what others have grabbed?

A: Yes, the system broadcasts in real-time: - Currency red packets: Shows the amount grabbed - Item red packets: Shows the grabbed item name and quantity

Q: How do I delete a red packet?

A: Only administrators can delete red packets: ``` /redpocketadmin delete <RedPacketID> ```

Q: What should I do if data is lost?

A: Please back up your database regularly: - MySQL: Regularly back up the `redpockets` database - SQLite: Back up the `plugins/RedPockets/redpockets.db` file

Q: Which economy plugins are supported?

A: Supports all Vault-compatible economy plugins: - EssentialsX - CMI - VaultEconomy - Other mainstream economy plugins

Q: What are the maximum amounts and quantities for red packets?

A: These can be configured in `config.yml`: ```yaml redpocket: max-amount: 100000.0 # Maximum amount max-count: 100 # Maximum quantity ```

Tips

1. Watch Expiry Time: Add notes to red packets to make them more meaningful 2. Watch Expiry Time: Preview item red packets before grabbing to see what items are available 3. Watch Expiry Time: Choose equal distribution mode for fair distribution 4. Watch Expiry Time: Choose random distribution mode to increase interactive fun 5. Watch Expiry Time: Default expiration is 1 hour, remember to grab in time

ADS