could you make the abilitys only work when you open the book up and the abilitys name is on a page and you have to click the page for the ability to activate
📄
pasted-code-1787782192571.txt
txt
61 lines
▶
# Chronos — Time Book & Quill
Create a Minecraft plugin that adds a custom **Book & Quill** named **"Chronos"**. The item should have three powerful time-themed abilities.
## Ability 1: Time Stop
When the player activates **Time Stop**:
* Stop time in a **30-block radius** around the user.
* The ability lasts for **30 seconds**.
* Every player and mob inside the radius, except the user, is completely frozen.
* Frozen entities cannot move, attack, use items, or activate abilities.
* The user can move and attack normally.
* Any damage dealt to frozen players during Time Stop should be **stored instead of immediately applied**.
* When Time Stop ends, all stored damage is applied to the affected players **simultaneously**.
* Display clock/ticking particles and sounds while Time Stop is active.
* Cooldown: **2 minutes**.
## Ability 2: Final Hour
When the player activates **Final Hour**:
* The user must target a player within **20 blocks**.
* Mark the targeted player with **white particles**.
* Display a **10-second countdown above the target's head**:
`10 → 9 → 8 → 7 → 6 → 5 → 4 → 3 → 2 → 1 → ☠`
* The target has a **25-block escape radius**.
* If the target moves more than **25 blocks away from the user** before the countdown reaches zero, cancel the ability.
* If the target is still within 25 blocks when the countdown reaches zero, **instantly kill the target**.
* Play a dramatic ticking-clock sound during the countdown.
* Play a powerful time/explosion sound when the countdown reaches zero.
* Cooldown: **2 minutes**.
## Ability 3: Mob Spawn
When the player activates **Mob Spawn**:
* Allow the user to choose between spawning a **Warden** or a **Charged Creeper**.
* Spawning a **Warden costs 50 XP levels**.
* Spawning a **Charged Creeper costs 50 XP levels**.
* The player must have at least **50 XP levels** to use either option.
* If the player has fewer than 50 levels, prevent the ability from activating and display:
**"You need 50 XP levels to use this ability."**
* Spawn the selected mob at the player's targeted location.
* When the mob spawns, create a dramatic **time-themed particle and sound effect**.
* The ability should not remove XP unless the mob successfully spawns.
* Cooldown: **60 seconds**.
## Item Requirements
* Item: **Book & Quill**
* Name: **Chronos**
* Give the item a unique identifier so the abilities only work with the Chronos Book & Quill.
* The abilities should not work with normal Books & Quills.
* Add a custom lore showing the three abilities and their cooldowns/costs.
* Add appropriate particle effects and sounds to make the item feel like a powerful time artifact.
* Prevent players from crafting or obtaining duplicate Chronos books unless specifically configured by the server owner.
* Make all ability values configurable in the plugin's config file.
Create the complete, functional Minecraft plugin with all required Java classes, event listeners, commands, configuration files, and `plugin.yml`. Make the code clean, organized, and ready to compile and install on a server.
Create the Gradle project and plugin metadata.
Add the Chronos item factory with book pages, lore, and a unique identifier.
Add a page-based GUI where abilities activate only after clicking their page.
Implement configurable Time Stop, Final Hour, Mob Spawn, cooldowns, freezing, damage storage, and duplicate protection.
Created the complete Chronos plugin.
Chronos is a uniquely identified Book & Quill.
Right-clicking the book opens a page-selection GUI.
Abilities only activate when their corresponding page is clicked.
Mob Spawn opens a second selection page for Warden or Charged Creeper.
Implemented configurable:
Time Stop radius, duration, and cooldown
Final Hour range, escape radius, countdown, and cooldown
Mob Spawn range, XP cost, and cooldown
Added frozen movement, attacks, item use, AI, targeting, and stored damage handling.
Added particles, sounds, countdown titles, XP validation, cooldowns, and duplicate protection.
Added
/chronos give [player].Added
plugin.yml,config.yml, Gradle configuration, and all Java classes.
can you make it so the warden and charged creeper ignore the player using the book
Track each summoned mob’s owner.
Prevent owned Wardens and charged creepers from targeting or damaging their summoner.
Updated the plugin so summoned Wardens and charged creepers ignore the player who spawned them:
They will not target their owner.
They cannot damage their owner.
If they attempt to target the owner, their target is cleared.
Ownership is tracked separately for every summoned mob.
package com.example.chronos;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
public final class ChronosPlugin extends JavaPlugin {
private ChronosItem chronosItem;
private AbilityManager abilityManager;
@Override
public void onEnable() {
saveDefaultConfig();
this.chronosItem = new ChronosItem(this);
this.abilityManager = new AbilityManager(this, chronosItem);
Bukkit.getPluginManager().registerEvents(new ChronosListener(this, abilityManager, chronosItem), this);
getCommand("chronos").setExecutor(new ChronosCommand(this, chronosItem));
}
@Override
public void onDisable() {
if (abilityManager != null) {
abilityManager.shutdown();
}
}
}