-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from vorlie/client-side-particles
Add Client-Side Configuration and Particle Options with Translations (v1.0.4)
- Loading branch information
Showing
17 changed files
with
367 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,53 @@ | ||
# **LifeDrain** | ||
|
||
**LifeDrain** adds a simple but powerful mechanic to Minecraft: stealing life from hostile mobs. Every time you attack, you’ll heal yourself based on the damage dealt, making combat a way to stay alive rather than just survive. | ||
|
||
🩸 **Features:** | ||
- Healing mechanics: | ||
- **Healing mechanics:** | ||
- Base healing scales with the difficulty level: | ||
- Easy: 2.0 HP | ||
- Normal: 1.0 HP | ||
- Hard: 0.5 HP | ||
- Bonus healing based on the damage dealt: 20% of the damage dealt. | ||
- Lifesteal cooldown is set to 1000 milliseconds (1 second) by default. | ||
- **Client-Side Features:** | ||
- **Particle Effects:** Enable or disable particle effects when healing is triggered. Particles are client-side, meaning they will only be visible on your screen. | ||
- **Client-Side Configuration Options:** Through **Cloth Config** and **Mod Menu**, you can customize particle effects, cooldown settings, and other features directly from the in-game settings menu. | ||
- Applies only to hostile mobs, ensuring lifesteal is balanced and works as intended in combat. | ||
|
||
⚙️ **Configuration:** | ||
- Customize healing values for different difficulty levels: | ||
- Base healing for Easy, Normal, and Hard modes. | ||
- Bonus healing multiplier based on the damage dealt. | ||
- Enable or disable particle effects when healing is triggered. | ||
- Adjust the cooldown for lifesteal activation (time between consecutive lifesteal uses). | ||
- Configuration is saved to `PATH-TO-MINECRAFT-INSTANCE/config/lifedrain.json` and can be modified directly. | ||
- **Client-Side Customization:** | ||
- Enable or disable particle effects when healing is triggered (client-side only). | ||
- Adjust the cooldown for lifesteal activation (time between consecutive lifesteal uses). | ||
- Configuration options are accessible through **Cloth Config** and **Mod Menu**. | ||
- All settings are saved to `lifedrain.json` and can be modified directly. | ||
- The config file is automatically updated to add missing values if they are not found. | ||
- Use the `/check_config` command to automatically check and update the config file if necessary. | ||
|
||
**Translations Available:** | ||
The mod is fully translated into the following languages: | ||
- **English** | ||
- **Polish** | ||
- **Spanish (Mexico)** | ||
- **Spanish** | ||
- **Chinese (Simplified)** | ||
- **Korean** | ||
- **Russian** | ||
- **German** | ||
- **Japanese** | ||
- **French** | ||
|
||
This mod is lightweight and perfect for anyone who enjoys combat-focused gameplay or just wants a little extra survivability. | ||
|
||
**Note:** Although the mod can be loaded in Minecraft `1.21.X`, it is not recommended. Attacking a hostile mob in versions other than `1.21` will cause your game to crash. | ||
|
||
**Requirements:** | ||
- Fabric Loader 0.16.10+ | ||
- Fabric API 0.102.0+1.21+ | ||
- Fabric Loader 0.16.10 | ||
- Fabric API 0.102.0 (for Minecraft 1.21) | ||
- Minecraft 1.21 | ||
- Java 21+ | ||
- Java 21 | ||
- **Cloth Config 15.0.140** (Client-side, optional) | ||
- **Mod Menu 11.0.3** (Client-side, optional) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
package vorlie.lifedrain; | ||
|
||
import com.terraformersmc.modmenu.api.ConfigScreenFactory; | ||
import com.terraformersmc.modmenu.api.ModMenuApi; | ||
|
||
import me.shedaniel.clothconfig2.api.ConfigBuilder; | ||
import me.shedaniel.clothconfig2.api.ConfigCategory; | ||
import me.shedaniel.clothconfig2.api.ConfigEntryBuilder; | ||
|
||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
|
||
import net.minecraft.text.Text; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import vorlie.lifedrain.config.ConfigManager; | ||
|
||
@Environment(EnvType.CLIENT) // Ensure this only runs on the client side | ||
public class ModMenuIntegration implements ModMenuApi { | ||
private static final Logger LOGGER = LoggerFactory.getLogger("lifedrain"); | ||
|
||
@Override | ||
public ConfigScreenFactory<?> getModConfigScreenFactory() { | ||
LOGGER.info("Lifesteal: ModMenuIntegration loaded successfully."); | ||
|
||
return parent -> { | ||
ConfigBuilder builder = ConfigBuilder.create() | ||
.setParentScreen(parent) | ||
.setTitle(Text.translatable("config.lifedrain.title")); | ||
|
||
ConfigCategory general = builder.getOrCreateCategory(Text.translatable("config.lifedrain.general")); | ||
ConfigEntryBuilder entryBuilder = builder.entryBuilder(); | ||
|
||
// Enable Particles | ||
general.addEntry(entryBuilder | ||
.startBooleanToggle(Text.translatable("config.lifedrain.enableParticles"), ConfigManager.CONFIG.enableParticles) | ||
.setDefaultValue(true) | ||
.setSaveConsumer(value -> ConfigManager.CONFIG.enableParticles = value) | ||
.setTooltip(Text.translatable("config.lifedrain.enableParticles.tooltip")) | ||
.build()); | ||
|
||
// Lifesteal Cooldown | ||
general.addEntry(entryBuilder | ||
.startIntField(Text.translatable("config.lifedrain.lifestealCooldown"), ConfigManager.CONFIG.lifestealCooldown) | ||
.setDefaultValue(1000) | ||
.setMin(0) | ||
.setSaveConsumer(value -> ConfigManager.CONFIG.lifestealCooldown = value) | ||
.setTooltip(Text.translatable("config.lifedrain.lifestealCooldown.tooltip")) | ||
.build()); | ||
|
||
// Base Heal (Easy) | ||
general.addEntry(entryBuilder | ||
.startFloatField(Text.translatable("config.lifedrain.baseHealEasy"), ConfigManager.CONFIG.baseHealEasy) | ||
.setDefaultValue(2.0F) | ||
.setMin(0.0F) | ||
.setSaveConsumer(value -> ConfigManager.CONFIG.baseHealEasy = value) | ||
.setTooltip(Text.translatable("config.lifedrain.baseHealEasy.tooltip")) | ||
.build()); | ||
|
||
// Base Heal (Normal) | ||
general.addEntry(entryBuilder | ||
.startFloatField(Text.translatable("config.lifedrain.baseHealNormal"), ConfigManager.CONFIG.baseHealNormal) | ||
.setDefaultValue(1.0F) | ||
.setMin(0.0F) | ||
.setSaveConsumer(value -> ConfigManager.CONFIG.baseHealNormal = value) | ||
.setTooltip(Text.translatable("config.lifedrain.baseHealNormal.tooltip")) | ||
.build()); | ||
|
||
// Base Heal (Hard) | ||
general.addEntry(entryBuilder | ||
.startFloatField(Text.translatable("config.lifedrain.baseHealHard"), ConfigManager.CONFIG.baseHealHard) | ||
.setDefaultValue(0.5F) | ||
.setMin(0.0F) | ||
.setSaveConsumer(value -> ConfigManager.CONFIG.baseHealHard = value) | ||
.setTooltip(Text.translatable("config.lifedrain.baseHealHard.tooltip")) | ||
.build()); | ||
|
||
// Bonus Heal Multiplier | ||
general.addEntry(entryBuilder | ||
.startFloatField(Text.translatable("config.lifedrain.bonusHealMultiplier"), ConfigManager.CONFIG.bonusHealMultiplier) | ||
.setDefaultValue(0.2F) | ||
.setMin(0.0F) | ||
.setSaveConsumer(value -> ConfigManager.CONFIG.bonusHealMultiplier = value) | ||
.setTooltip(Text.translatable("config.lifedrain.bonusHealMultiplier.tooltip")) | ||
.build()); | ||
|
||
builder.setSavingRunnable(ConfigManager::save); | ||
return builder.build(); | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"config.lifedrain.title": "LifeDrain Konfiguration", | ||
"config.lifedrain.general": "Allgemein", | ||
"config.lifedrain.enableParticles": "Partikel aktivieren", | ||
"config.lifedrain.lifestealCooldown": "Lebensdiebstahl Abklingzeit (ms)", | ||
"config.lifedrain.baseHealEasy": "Basisheilung (Einfach)", | ||
"config.lifedrain.baseHealNormal": "Basisheilung (Normal)", | ||
"config.lifedrain.baseHealHard": "Basisheilung (Schwierig)", | ||
"config.lifedrain.bonusHealMultiplier": "Bonus Heilungs Multiplikator", | ||
"config.lifedrain.enableParticles.tooltip": "Diese Einstellung betrifft nur den Client. Der Server kann sie überschreiben. Im Einzelspieler-Modus funktionieren die Werte lokal.", | ||
"config.lifedrain.lifestealCooldown.tooltip": "Der Cooldown-Wert des Servers wird verwendet, und die Client-Einstellungen werden ignoriert. Im Einzelspieler-Modus funktionieren die Werte lokal.", | ||
"config.lifedrain.baseHealEasy.tooltip": "Der Server bestimmt die Grundheilungswerte. Im Einzelspieler-Modus funktionieren die Werte lokal.", | ||
"config.lifedrain.baseHealNormal.tooltip": "Der Server bestimmt die Grundheilungswerte. Im Einzelspieler-Modus funktionieren die Werte lokal.", | ||
"config.lifedrain.baseHealHard.tooltip": "Der Server bestimmt die Grundheilungswerte. Im Einzelspieler-Modus funktionieren die Werte lokal.", | ||
"config.lifedrain.bonusHealMultiplier.tooltip": "Der Server bestimmt den Bonusheilungs-Multiplikator. Im Einzelspieler-Modus funktionieren die Werte lokal." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"config.lifedrain.title": "LifeDrain Configuration", | ||
"config.lifedrain.general": "General", | ||
"config.lifedrain.enableParticles": "Enable Particles", | ||
"config.lifedrain.lifestealCooldown": "Lifesteal Cooldown (ms)", | ||
"config.lifedrain.baseHealEasy": "Base Heal (Easy)", | ||
"config.lifedrain.baseHealNormal": "Base Heal (Normal)", | ||
"config.lifedrain.baseHealHard": "Base Heal (Hard)", | ||
"config.lifedrain.bonusHealMultiplier": "Bonus Heal Multiplier", | ||
"config.lifedrain.enableParticles.tooltip": "This setting only affects the client. The server may override it. In single-player, values will work locally.", | ||
"config.lifedrain.lifestealCooldown.tooltip": "Server-side cooldown value is used, and client settings are ignored. In single-player, values will work locally.", | ||
"config.lifedrain.baseHealEasy.tooltip": "Server determines the base healing values. In single-player, values will work locally.", | ||
"config.lifedrain.baseHealNormal.tooltip": "Server determines the base healing values. In single-player, values will work locally.", | ||
"config.lifedrain.baseHealHard.tooltip": "Server determines the base healing values. In single-player, values will work locally.", | ||
"config.lifedrain.bonusHealMultiplier.tooltip": "Server determines the bonus healing multiplier. In single-player, values will work locally." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"config.lifedrain.title": "Configuración de LifeDrain", | ||
"config.lifedrain.general": "General", | ||
"config.lifedrain.enableParticles": "Habilitar partículas", | ||
"config.lifedrain.lifestealCooldown": "Tiempo de recarga de robar vida (ms)", | ||
"config.lifedrain.baseHealEasy": "Curación base (Fácil)", | ||
"config.lifedrain.baseHealNormal": "Curación base (Normal)", | ||
"config.lifedrain.baseHealHard": "Curación base (Difícil)", | ||
"config.lifedrain.bonusHealMultiplier": "Multiplicador de curación adicional", | ||
"config.lifedrain.enableParticles.tooltip": "Esta opción solo afecta al cliente. El servidor puede sobrescribirla. En single-player, los valores funcionarán localmente.", | ||
"config.lifedrain.lifestealCooldown.tooltip": "El valor de cooldown del servidor se usa, y los ajustes del cliente son ignorados. En single-player, los valores funcionarán localmente.", | ||
"config.lifedrain.baseHealEasy.tooltip": "El servidor determina los valores base de curación. En single-player, los valores funcionarán localmente.", | ||
"config.lifedrain.baseHealNormal.tooltip": "El servidor determina los valores base de curación. En single-player, los valores funcionarán localmente.", | ||
"config.lifedrain.baseHealHard.tooltip": "El servidor determina los valores base de curación. En single-player, los valores funcionarán localmente.", | ||
"config.lifedrain.bonusHealMultiplier.tooltip": "El servidor determina el multiplicador de curación adicional. En single-player, los valores funcionarán localmente." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"config.lifedrain.title": "Configuración de LifeDrain", | ||
"config.lifedrain.general": "General", | ||
"config.lifedrain.enableParticles": "Activar partículas", | ||
"config.lifedrain.lifestealCooldown": "Tiempo de recarga de robo de vida (ms)", | ||
"config.lifedrain.baseHealEasy": "Curación base (Fácil)", | ||
"config.lifedrain.baseHealNormal": "Curación base (Normal)", | ||
"config.lifedrain.baseHealHard": "Curación base (Difícil)", | ||
"config.lifedrain.bonusHealMultiplier": "Multiplicador de curación extra", | ||
"config.lifedrain.enableParticles.tooltip": "Esta opción solo afecta al cliente. El servidor puede sobrescribirla. En single-player, los valores funcionarán localmente.", | ||
"config.lifedrain.lifestealCooldown.tooltip": "El valor de cooldown del servidor se usa, y los ajustes del cliente son ignorados. En single-player, los valores funcionarán localmente.", | ||
"config.lifedrain.baseHealEasy.tooltip": "El servidor determina los valores base de curación. En single-player, los valores funcionarán localmente.", | ||
"config.lifedrain.baseHealNormal.tooltip": "El servidor determina los valores base de curación. En single-player, los valores funcionarán localmente.", | ||
"config.lifedrain.baseHealHard.tooltip": "El servidor determina los valores base de curación. En single-player, los valores funcionarán localmente.", | ||
"config.lifedrain.bonusHealMultiplier.tooltip": "El servidor determina el multiplicador de curación adicional. En single-player, los valores funcionarán localmente." | ||
} |
Oops, something went wrong.