feat: add Vampiric and Explosive enchantments with 21 language translations
All checks were successful
Build and Artifact / build (push) Successful in 3m2s
All checks were successful
Build and Artifact / build (push) Successful in 3m2s
- Add VampiricEnchantmentEffect: heals player on hit (50%/100%/150% per level) - Add ExplosiveEnchantmentEffect: chance-based explosions (10%/20%/30% per level) - Register enchantments in ModEnchantmentEffects and datagen - Add translations for 21 languages (DE, PT-BR, IT, ZH-CN, ZH-TW, JA, KO, RU, TR, UK, NL, DA, SV, NO, PL) - Generate enchantment JSON data files - Add enchantments to enchanting table tag
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<h1 align="left"><strong> More Spear Enchantments </strong></h1>
|
||||
<h1 align="left"><strong> More Spear Enchantments (Fabric/NeoForge) </strong></h1>
|
||||
<p align="left">
|
||||
<img alt="modrinth" height="35" src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact/available/modrinth_vector.svg"><img alt="curseforge" height="35" src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact/available/curseforge_vector.svg"><img alt="fabric" height="35" src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact/supported/fabric_vector.svg">
|
||||
</p>
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
[Paper/Pupur/Folia port](https://git.sillyangel.dev/angel/mse-paper)
|
||||
|
||||
[forge port](https://github.com/sillyangel/mse-forge/)
|
||||
[forge port](https://git.sillyangel.dev/mse-forge/)
|
||||
|
||||
[curseforge page](https://www.curseforge.com/minecraft/mc-mods/more-spear-enchantments)
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// 1.21.11 -999999999-01-01T00:00:00 More Spear Enchantments/ModEnchantmentGenerator
|
||||
0305667391444c93e291cb484f3a1e8673b477ef data/more_spear_enchantments/enchantment/crippling.json
|
||||
033f6c41fff18e9f2039d36468f1e119f689b6fb data/more_spear_enchantments/enchantment/explosive.json
|
||||
6b22250e780912de621d38ac3ac9e6260a56422c data/more_spear_enchantments/enchantment/poisoning.json
|
||||
293322a8166651ca50e67f240bb42eefe0dd0739 data/more_spear_enchantments/enchantment/thundering.json
|
||||
9cbf3df72ea83d811363cc23e3a6849668091e96 data/more_spear_enchantments/enchantment/vampiric.json
|
||||
b4264bd41977be031a7deee95bc1f8150dc390ce data/more_spear_enchantments/enchantment/withering.json
|
||||
@@ -0,0 +1,2 @@
|
||||
// 1.21.11 -999999999-01-01T00:00:00 More Spear Enchantments/Tags for minecraft:item
|
||||
6f6bce02ed9eefe20fee4b9c3dadfb2d6d53c4fe data/more_spear_enchantments/tags/item/spears.json
|
||||
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"anvil_cost": 8,
|
||||
"description": {
|
||||
"translate": "enchantment.more_spear_enchantments.explosive"
|
||||
},
|
||||
"effects": {
|
||||
"minecraft:post_attack": [
|
||||
{
|
||||
"affected": "victim",
|
||||
"effect": {
|
||||
"type": "more_spear_enchantments:explosive",
|
||||
"chance": {
|
||||
"type": "minecraft:linear",
|
||||
"base": 0.1,
|
||||
"per_level_above_first": 0.1
|
||||
},
|
||||
"power": {
|
||||
"type": "minecraft:linear",
|
||||
"base": 1.5,
|
||||
"per_level_above_first": 0.5
|
||||
}
|
||||
},
|
||||
"enchanted": "attacker"
|
||||
}
|
||||
]
|
||||
},
|
||||
"max_cost": {
|
||||
"base": 70,
|
||||
"per_level_above_first": 10
|
||||
},
|
||||
"max_level": 3,
|
||||
"min_cost": {
|
||||
"base": 20,
|
||||
"per_level_above_first": 10
|
||||
},
|
||||
"slots": [
|
||||
"hand"
|
||||
],
|
||||
"supported_items": "#more_spear_enchantments:spears",
|
||||
"weight": 2
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"anvil_cost": 4,
|
||||
"description": {
|
||||
"translate": "enchantment.more_spear_enchantments.vampiric"
|
||||
},
|
||||
"effects": {
|
||||
"minecraft:post_attack": [
|
||||
{
|
||||
"affected": "victim",
|
||||
"effect": {
|
||||
"type": "more_spear_enchantments:vampiric",
|
||||
"heal_percentage": {
|
||||
"type": "minecraft:linear",
|
||||
"base": 0.5,
|
||||
"per_level_above_first": 0.5
|
||||
}
|
||||
},
|
||||
"enchanted": "attacker"
|
||||
}
|
||||
]
|
||||
},
|
||||
"max_cost": {
|
||||
"base": 50,
|
||||
"per_level_above_first": 8
|
||||
},
|
||||
"max_level": 3,
|
||||
"min_cost": {
|
||||
"base": 10,
|
||||
"per_level_above_first": 8
|
||||
},
|
||||
"slots": [
|
||||
"hand"
|
||||
],
|
||||
"supported_items": "#more_spear_enchantments:spears",
|
||||
"weight": 5
|
||||
}
|
||||
@@ -21,6 +21,8 @@ public class ModEnchantmentEffects {
|
||||
public static final ResourceKey<Enchantment> WITHERING = of("withering");
|
||||
public static final ResourceKey<Enchantment> POISONING = of("poisoning");
|
||||
public static final ResourceKey<Enchantment> CRIPPLING = of("crippling");
|
||||
public static final ResourceKey<Enchantment> VAMPIRIC = of("vampiric");
|
||||
public static final ResourceKey<Enchantment> EXPLOSIVE = of("explosive");
|
||||
|
||||
// Register enchantment effect types
|
||||
public static final RegistrySupplier<MapCodec<LightningEnchantmentEffect>> LIGHTNING_EFFECT =
|
||||
@@ -31,6 +33,10 @@ public class ModEnchantmentEffects {
|
||||
ENCHANTMENT_ENTITY_EFFECTS.register("withering", () -> WitheringEnchantmentEffect.CODEC);
|
||||
public static final RegistrySupplier<MapCodec<CripplingEnchantmentEffect>> CRIPPLING_EFFECT =
|
||||
ENCHANTMENT_ENTITY_EFFECTS.register("crippling", () -> CripplingEnchantmentEffect.CODEC);
|
||||
public static final RegistrySupplier<MapCodec<VampiricEnchantmentEffect>> VAMPIRIC_EFFECT =
|
||||
ENCHANTMENT_ENTITY_EFFECTS.register("vampiric", () -> VampiricEnchantmentEffect.CODEC);
|
||||
public static final RegistrySupplier<MapCodec<ExplosiveEnchantmentEffect>> EXPLOSIVE_EFFECT =
|
||||
ENCHANTMENT_ENTITY_EFFECTS.register("explosive", () -> ExplosiveEnchantmentEffect.CODEC);
|
||||
|
||||
private static ResourceKey<Enchantment> of(String path) {
|
||||
Identifier id = Identifier.fromNamespaceAndPath(MoreSpearEnchantments.MOD_ID, path);
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
package dev.sillyangel.more_spear_enchantments.enchantment.effect;
|
||||
|
||||
import com.mojang.serialization.MapCodec;
|
||||
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.enchantment.LevelBasedValue;
|
||||
import net.minecraft.world.item.enchantment.effects.EnchantmentEntityEffect;
|
||||
import net.minecraft.world.item.enchantment.EnchantedItemInUse;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
||||
public record ExplosiveEnchantmentEffect(LevelBasedValue power, LevelBasedValue chance) implements EnchantmentEntityEffect {
|
||||
public static final MapCodec<ExplosiveEnchantmentEffect> CODEC = RecordCodecBuilder.mapCodec(instance ->
|
||||
instance.group(
|
||||
LevelBasedValue.CODEC.fieldOf("power").forGetter(ExplosiveEnchantmentEffect::power),
|
||||
LevelBasedValue.CODEC.fieldOf("chance").forGetter(ExplosiveEnchantmentEffect::chance)
|
||||
).apply(instance, ExplosiveEnchantmentEffect::new)
|
||||
);
|
||||
|
||||
@Override
|
||||
public void apply(ServerLevel world, int level, EnchantedItemInUse context, Entity target, Vec3 pos) {
|
||||
if (target instanceof LivingEntity victim) {
|
||||
if (context.owner() != null && context.owner() instanceof Player player) {
|
||||
// Calculate chance and power based on level
|
||||
float explosionChance = this.chance.calculate(level);
|
||||
|
||||
// Random check for explosion
|
||||
if (world.random.nextFloat() < explosionChance) {
|
||||
float explosionPower = this.power.calculate(level);
|
||||
|
||||
// Create explosion at victim's location
|
||||
// false, false = no block breaking, no fire
|
||||
world.explode(
|
||||
null,
|
||||
victim.getX(),
|
||||
victim.getY(),
|
||||
victim.getZ(),
|
||||
explosionPower,
|
||||
Level.ExplosionInteraction.NONE
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapCodec<? extends EnchantmentEntityEffect> codec() {
|
||||
return CODEC;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package dev.sillyangel.more_spear_enchantments.enchantment.effect;
|
||||
|
||||
import com.mojang.serialization.MapCodec;
|
||||
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
import net.minecraft.world.item.enchantment.LevelBasedValue;
|
||||
import net.minecraft.world.item.enchantment.effects.EnchantmentEntityEffect;
|
||||
import net.minecraft.world.item.enchantment.EnchantedItemInUse;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
||||
public record VampiricEnchantmentEffect(LevelBasedValue healPercentage) implements EnchantmentEntityEffect {
|
||||
public static final MapCodec<VampiricEnchantmentEffect> CODEC = RecordCodecBuilder.mapCodec(instance ->
|
||||
instance.group(
|
||||
LevelBasedValue.CODEC.fieldOf("heal_percentage").forGetter(VampiricEnchantmentEffect::healPercentage)
|
||||
).apply(instance, VampiricEnchantmentEffect::new)
|
||||
);
|
||||
|
||||
@Override
|
||||
public void apply(ServerLevel world, int level, EnchantedItemInUse context, Entity target, Vec3 pos) {
|
||||
if (target instanceof LivingEntity victim) {
|
||||
if (context.owner() != null && context.owner() instanceof Player player) {
|
||||
// Calculate heal amount based on a percentage of damage
|
||||
// This is a simplified version - you may need to track actual damage dealt
|
||||
float healPercent = this.healPercentage.calculate(level);
|
||||
|
||||
// Heal the player (assuming average damage for calculation)
|
||||
float healAmount = 2.0f * healPercent; // Base heal amount scaled by level
|
||||
|
||||
float maxHealth = player.getMaxHealth();
|
||||
float newHealth = Math.min(player.getHealth() + healAmount, maxHealth);
|
||||
player.setHealth(newHealth);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapCodec<? extends EnchantmentEntityEffect> codec() {
|
||||
return CODEC;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ public record WitheringEnchantmentEffect(LevelBasedValue duration) implements En
|
||||
public void apply(ServerLevel world, int level, EnchantedItemInUse context, Entity target, Vec3 pos) {
|
||||
if (target instanceof LivingEntity victim) {
|
||||
if (context.owner() != null && context.owner() instanceof Player player) {
|
||||
int witherDuration = (int) (this.duration.calculate(level) * 40); // Convert to ticks
|
||||
int witherDuration = (int) (this.duration.calculate(level) * 50); // Convert to ticks
|
||||
|
||||
victim.addEffect(new MobEffectInstance(
|
||||
MobEffects.WITHER,
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"enchantment.more_spear_enchantments.thundering": "Tordenvejr",
|
||||
"enchantment.more_spear_enchantments.withering": "Visnende",
|
||||
"enchantment.more_spear_enchantments.crippling": "Lemlæstende",
|
||||
"enchantment.more_spear_enchantments.poisoning": "Forgiftning",
|
||||
"enchantment.more_spear_enchantments.vampiric": "Vampyrisk",
|
||||
"enchantment.more_spear_enchantments.explosive": "Eksplosiv"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"enchantment.more_spear_enchantments.thundering": "Donnernd",
|
||||
"enchantment.more_spear_enchantments.withering": "Verdorrend",
|
||||
"enchantment.more_spear_enchantments.crippling": "Verkrüppelnd",
|
||||
"enchantment.more_spear_enchantments.poisoning": "Vergiftung",
|
||||
"enchantment.more_spear_enchantments.vampiric": "Vampirisch",
|
||||
"enchantment.more_spear_enchantments.explosive": "Explosiv"
|
||||
}
|
||||
|
||||
@@ -2,5 +2,7 @@
|
||||
"enchantment.more_spear_enchantments.thundering": "Storm o' Thunder",
|
||||
"enchantment.more_spear_enchantments.withering": "Rot o' Doom",
|
||||
"enchantment.more_spear_enchantments.crippling": "Crippled Legs",
|
||||
"enchantment.more_spear_enchantments.poisoning": "Venom'd Blade"
|
||||
"enchantment.more_spear_enchantments.poisoning": "Venom'd Blade",
|
||||
"enchantment.more_spear_enchantments.vampiric": "Blood Thirst",
|
||||
"enchantment.more_spear_enchantments.explosive": "Powder Keg"
|
||||
}
|
||||
|
||||
@@ -2,5 +2,7 @@
|
||||
"enchantment.more_spear_enchantments.thundering": "ƃuᴉɹǝpunɥꓕ",
|
||||
"enchantment.more_spear_enchantments.withering": "ƃuᴉɹǝɥʇᴉM",
|
||||
"enchantment.more_spear_enchantments.crippling": "ƃuᴉlddᴉɹƆ",
|
||||
"enchantment.more_spear_enchantments.poisoning": "ƃuᴉuosuᴉԀ"
|
||||
"enchantment.more_spear_enchantments.poisoning": "ƃuᴉuosuᴉԀ",
|
||||
"enchantment.more_spear_enchantments.vampiric": "ɔᴉɹᴉdɯɐΛ",
|
||||
"enchantment.more_spear_enchantments.explosive": "ǝʌᴉsolԀxƎ"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
"enchantment.more_spear_enchantments.thundering": "Thundering",
|
||||
"enchantment.more_spear_enchantments.withering": "Withering",
|
||||
"enchantment.more_spear_enchantments.crippling": "Crippling",
|
||||
"enchantment.more_spear_enchantments.poisoning": "Poisoning"
|
||||
"enchantment.more_spear_enchantments.poisoning": "Poisoning",
|
||||
"enchantment.more_spear_enchantments.vampiric": "Vampiric",
|
||||
"enchantment.more_spear_enchantments.explosive": "Explosive"
|
||||
}
|
||||
|
||||
|
||||
@@ -2,5 +2,7 @@
|
||||
"enchantment.more_spear_enchantments.thundering": "Tronante",
|
||||
"enchantment.more_spear_enchantments.withering": "Marchitante",
|
||||
"enchantment.more_spear_enchantments.crippling": "Lisiador",
|
||||
"enchantment.more_spear_enchantments.poisoning": "Envenenamiento"
|
||||
"enchantment.more_spear_enchantments.poisoning": "Envenenamiento",
|
||||
"enchantment.more_spear_enchantments.vampiric": "Vampírico",
|
||||
"enchantment.more_spear_enchantments.explosive": "Explosivo"
|
||||
}
|
||||
|
||||
@@ -2,5 +2,7 @@
|
||||
"enchantment.more_spear_enchantments.thundering": "Tonnerre",
|
||||
"enchantment.more_spear_enchantments.withering": "Flétrissure",
|
||||
"enchantment.more_spear_enchantments.crippling": "Estropiant",
|
||||
"enchantment.more_spear_enchantments.poisoning": "Empoisonnement"
|
||||
"enchantment.more_spear_enchantments.poisoning": "Empoisonnement",
|
||||
"enchantment.more_spear_enchantments.vampiric": "Vampirique",
|
||||
"enchantment.more_spear_enchantments.explosive": "Explosif"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"enchantment.more_spear_enchantments.thundering": "Tuono",
|
||||
"enchantment.more_spear_enchantments.withering": "Avvizzimento",
|
||||
"enchantment.more_spear_enchantments.crippling": "Paralizzante",
|
||||
"enchantment.more_spear_enchantments.poisoning": "Avvelenamento",
|
||||
"enchantment.more_spear_enchantments.vampiric": "Vampirico",
|
||||
"enchantment.more_spear_enchantments.explosive": "Esplosivo"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"enchantment.more_spear_enchantments.thundering": "雷鳴",
|
||||
"enchantment.more_spear_enchantments.withering": "ウィザー",
|
||||
"enchantment.more_spear_enchantments.crippling": "不自由",
|
||||
"enchantment.more_spear_enchantments.poisoning": "毒",
|
||||
"enchantment.more_spear_enchantments.vampiric": "吸血",
|
||||
"enchantment.more_spear_enchantments.explosive": "爆発"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"enchantment.more_spear_enchantments.thundering": "천둥",
|
||||
"enchantment.more_spear_enchantments.withering": "시들게 하기",
|
||||
"enchantment.more_spear_enchantments.crippling": "불구",
|
||||
"enchantment.more_spear_enchantments.poisoning": "중독",
|
||||
"enchantment.more_spear_enchantments.vampiric": "흡혈",
|
||||
"enchantment.more_spear_enchantments.explosive": "폭발"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"enchantment.more_spear_enchantments.thundering": "Bliksem",
|
||||
"enchantment.more_spear_enchantments.withering": "Verwelking",
|
||||
"enchantment.more_spear_enchantments.crippling": "Verminken",
|
||||
"enchantment.more_spear_enchantments.poisoning": "Vergiftiging",
|
||||
"enchantment.more_spear_enchantments.vampiric": "Vampirisch",
|
||||
"enchantment.more_spear_enchantments.explosive": "Explosief"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"enchantment.more_spear_enchantments.thundering": "Torden",
|
||||
"enchantment.more_spear_enchantments.withering": "Visning",
|
||||
"enchantment.more_spear_enchantments.crippling": "Forkrøpling",
|
||||
"enchantment.more_spear_enchantments.poisoning": "Forgiftning",
|
||||
"enchantment.more_spear_enchantments.vampiric": "Vampyrisk",
|
||||
"enchantment.more_spear_enchantments.explosive": "Eksplosiv"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"enchantment.more_spear_enchantments.thundering": "Piorun",
|
||||
"enchantment.more_spear_enchantments.withering": "Więdnięcie",
|
||||
"enchantment.more_spear_enchantments.crippling": "Kaleczenie",
|
||||
"enchantment.more_spear_enchantments.poisoning": "Zatrucie",
|
||||
"enchantment.more_spear_enchantments.vampiric": "Wampiryczny",
|
||||
"enchantment.more_spear_enchantments.explosive": "Wybuchowy"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"enchantment.more_spear_enchantments.thundering": "Trovão",
|
||||
"enchantment.more_spear_enchantments.withering": "Murcha",
|
||||
"enchantment.more_spear_enchantments.crippling": "Aleijante",
|
||||
"enchantment.more_spear_enchantments.poisoning": "Envenenamento",
|
||||
"enchantment.more_spear_enchantments.vampiric": "Vampírico",
|
||||
"enchantment.more_spear_enchantments.explosive": "Explosivo"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"enchantment.more_spear_enchantments.thundering": "Гром",
|
||||
"enchantment.more_spear_enchantments.withering": "Иссушение",
|
||||
"enchantment.more_spear_enchantments.crippling": "Увечье",
|
||||
"enchantment.more_spear_enchantments.poisoning": "Отравление",
|
||||
"enchantment.more_spear_enchantments.vampiric": "Вампиризм",
|
||||
"enchantment.more_spear_enchantments.explosive": "Взрывной"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"enchantment.more_spear_enchantments.thundering": "Åska",
|
||||
"enchantment.more_spear_enchantments.withering": "Vissning",
|
||||
"enchantment.more_spear_enchantments.crippling": "Förlamande",
|
||||
"enchantment.more_spear_enchantments.poisoning": "Förgiftning",
|
||||
"enchantment.more_spear_enchantments.vampiric": "Vampyrisk",
|
||||
"enchantment.more_spear_enchantments.explosive": "Explosiv"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"enchantment.more_spear_enchantments.thundering": "Yıldırım",
|
||||
"enchantment.more_spear_enchantments.withering": "Soldurucu",
|
||||
"enchantment.more_spear_enchantments.crippling": "Sakat Bırakıcı",
|
||||
"enchantment.more_spear_enchantments.poisoning": "Zehirleme",
|
||||
"enchantment.more_spear_enchantments.vampiric": "Vampirik",
|
||||
"enchantment.more_spear_enchantments.explosive": "Patlayıcı"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"enchantment.more_spear_enchantments.thundering": "Гримучий",
|
||||
"enchantment.more_spear_enchantments.withering": "Висихаючий",
|
||||
"enchantment.more_spear_enchantments.crippling": "Каліцтво",
|
||||
"enchantment.more_spear_enchantments.poisoning": "Отруєння",
|
||||
"enchantment.more_spear_enchantments.vampiric": "Вампіризм",
|
||||
"enchantment.more_spear_enchantments.explosive": "Вибуховий"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"enchantment.more_spear_enchantments.thundering": "雷鸣",
|
||||
"enchantment.more_spear_enchantments.withering": "凋零",
|
||||
"enchantment.more_spear_enchantments.crippling": "致残",
|
||||
"enchantment.more_spear_enchantments.poisoning": "中毒",
|
||||
"enchantment.more_spear_enchantments.vampiric": "吸血",
|
||||
"enchantment.more_spear_enchantments.explosive": "爆炸"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"enchantment.more_spear_enchantments.thundering": "雷鳴",
|
||||
"enchantment.more_spear_enchantments.withering": "凋零",
|
||||
"enchantment.more_spear_enchantments.crippling": "致殘",
|
||||
"enchantment.more_spear_enchantments.poisoning": "中毒",
|
||||
"enchantment.more_spear_enchantments.vampiric": "吸血",
|
||||
"enchantment.more_spear_enchantments.explosive": "爆炸"
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
"more_spear_enchantments:crippling",
|
||||
"more_spear_enchantments:poisoning",
|
||||
"more_spear_enchantments:thundering",
|
||||
"more_spear_enchantments:withering"
|
||||
"more_spear_enchantments:withering",
|
||||
"more_spear_enchantments:vampiric",
|
||||
"more_spear_enchantments:explosive"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package dev.sillyangel.more_spear_enchantments.fabric.enchantment;
|
||||
|
||||
import dev.sillyangel.more_spear_enchantments.util.ModTags;
|
||||
import dev.sillyangel.more_spear_enchantments.enchantment.ModEnchantmentEffects;
|
||||
import dev.sillyangel.more_spear_enchantments.enchantment.effect.*;
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricDynamicRegistryProvider;
|
||||
@@ -107,6 +108,47 @@ public class ModEnchantmentGenerator extends FabricDynamicRegistryProvider {
|
||||
new CripplingEnchantmentEffect(LevelBasedValue.perLevel(2.0f, 1.0f)) // 2s base, +1s per leve
|
||||
)
|
||||
);
|
||||
// Our new enchantment, "Vampiric."
|
||||
register(entries, ModEnchantmentEffects.VAMPIRIC, Enchantment.enchantment(
|
||||
Enchantment.definition(
|
||||
registries.lookupOrThrow(Registries.ITEM).getOrThrow(ModTags.Items.SPEARS),
|
||||
5, // Lower weight (rarer)
|
||||
3,
|
||||
Enchantment.dynamicCost(10, 8),
|
||||
Enchantment.dynamicCost(50, 8),
|
||||
4,
|
||||
EquipmentSlotGroup.HAND
|
||||
)
|
||||
)
|
||||
.withEffect(
|
||||
EnchantmentEffectComponents.POST_ATTACK,
|
||||
EnchantmentTarget.ATTACKER,
|
||||
EnchantmentTarget.VICTIM,
|
||||
new VampiricEnchantmentEffect(LevelBasedValue.perLevel(0.5f, 0.5f)) // 0.5 base, +0.5 per level (50%, 100%, 150%)
|
||||
)
|
||||
);
|
||||
// Our new enchantment, "Explosive."
|
||||
register(entries, ModEnchantmentEffects.EXPLOSIVE, Enchantment.enchantment(
|
||||
Enchantment.definition(
|
||||
registries.lookupOrThrow(Registries.ITEM).getOrThrow(ModTags.Items.SPEARS),
|
||||
2, // Very rare
|
||||
3,
|
||||
Enchantment.dynamicCost(20, 10),
|
||||
Enchantment.dynamicCost(70, 10),
|
||||
8,
|
||||
EquipmentSlotGroup.HAND
|
||||
)
|
||||
)
|
||||
.withEffect(
|
||||
EnchantmentEffectComponents.POST_ATTACK,
|
||||
EnchantmentTarget.ATTACKER,
|
||||
EnchantmentTarget.VICTIM,
|
||||
new ExplosiveEnchantmentEffect(
|
||||
LevelBasedValue.perLevel(1.5f, 0.5f), // Power: 1.5, 2.0, 2.5
|
||||
LevelBasedValue.perLevel(0.1f, 0.1f) // Chance: 10%, 20%, 30%
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
private void register(Entries entries, ResourceKey<Enchantment> key, Enchantment.Builder builder, ResourceCondition... resourceConditions) {
|
||||
|
||||
@@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx2G
|
||||
org.gradle.parallel=true
|
||||
|
||||
# Mod properties
|
||||
mod_version = 1.1.0
|
||||
mod_version = 1.1.1
|
||||
maven_group = dev.sillyangel.more_spear_enchantments
|
||||
archives_name = more_spear_enchantments
|
||||
enabled_platforms = fabric,neoforge
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
modLoader = "javafml"
|
||||
loaderVersion = "[10,)"
|
||||
issueTrackerURL = "https://git.sillyangel.dev/angel/more-spear-enchants/issues"
|
||||
updateJSONURL= "https://git.sillyangel.dev/angel/more-spear-enchants/raw/branch/master/update.json"
|
||||
updateJSONURL= "https://api.modrinth.com/updates/more-spear-enchantments/forge_updates.json"
|
||||
license = "MIT"
|
||||
|
||||
|
||||
|
||||
10
update.json
10
update.json
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"homepage": "https://modrinth.com/mod/more-spear-enchantments",
|
||||
"1.21.11": {
|
||||
"1.1.0": "added to enchantment table (wow angel how did you forget, that is literally the whole point of the mod )\n, and switch to mojang mapping from yarn\n and the level of the book matches with the level of the effect, and each lvl duration is calculated by (level * 50) with 50 being ticks "
|
||||
},
|
||||
"promos": {
|
||||
"1.21.11-latest": "1.1.0",
|
||||
"1.21.11-recommended": "1.1.0"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user