trigger_god
๐Ÿ“Ž 1 file 1,852 chars
๐Ÿ“„
pasted-code-1772625024040.txt
txt 85 lines
โ–ถ
Create a Minecraft Spigot/Paper plugin (Java) with the following features.

Plugin Name: Welcome

Compatibility:

- Spigot / Paper 1.20+
- Java 17

Main Features:

1. First Join Welcome Screen

- When a player joins the server for the first time, show a large screen message (Title) instead of a chat message.

Title:
Welcome, {user}

- "{user}" should automatically be replaced with the player's name.

- A firework (firecracker) should spawn at the player's location when they join for the first time.

2. Welcome Back Message

- If a player joins the server and their last login was more than 12 hours ago, show a Title message:

Welcome back, {user}

- This message should also appear on screen (Title), not in chat.

3. Chat Info Message

- When any player joins (new or returning), send an information message in chat instead of a welcome message.

Example:

play.picklemc.top
website :
discord :

- These messages must be fully configurable in config.yml so the server owner can change them.

Configuration:

Example "config.yml":

first-join-title: "Welcome, {user}"
welcome-back-title: "Welcome back, {user}"

chat-info:
  - "play.picklemc.top"
  - "website : yourwebsite.com"
  - "discord : discord.gg/example"

firework:
  enabled: true
  power: 1

Behavior Rules:

- First join โ†’ show Welcome title + firework
- Returning player after 12 hours โ†’ show Welcome back title
- Chat should NOT show the normal join message
- Instead send the configurable info messages

Events:

- Use PlayerJoinEvent
- Check player.hasPlayedBefore()
- Check player.getLastPlayed() to determine if the player was offline for more than 12 hours

Files to Generate:
Provide full code including:

- Main plugin class
- Event listener class
- plugin.yml
- config.yml

plugin.yml should include:

name: Welcome
version: 1.0
main: your.package.Welcome
api-version: 1.20
Kodari AI
KodariMar 4 at 11:51 am 9,475 (v2)

Iโ€™ll create a Welcome plugin with customizable title messages, fireworks for first-time players, and configurable chat info.

Welcome
A welcome plugin that displays customizable title messages and fireworks for first-time and returning players, with configurable chat information. Features include first-join fireworks, welcome-back messages for players returning after 12+ hours, and fully customizable chat info messages.

Created a complete Welcome plugin with first-join title messages, firework effects, welcome-back titles for returning players (12+ hours offline), and fully configurable chat info messages that replace the default join message.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
6 179
src/main/java/com/picklemc/welcome/Welcome.java
package com.picklemc.welcome;

import com.picklemc.welcome.listener.JoinListener;
import org.bukkit.plugin.java.JavaPlugin;

public class Welcome extends JavaPlugin {
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        getServer().getPluginManager().registerEvents(new JoinListener(this), this);
        getLogger().info("Welcome plugin has been enabled!");
    }
    
    @Override
    public void onDisable() {
        getLogger().info("Welcome plugin has been disabled!");
    }
}