Compare commits
6 Commits
78b064a414
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| ecd061ec08 | |||
|
f3dbe89d8e
|
|||
| 6652a25d8a | |||
|
c01c91841d
|
|||
|
0898d5e374
|
|||
|
5dca2e112c
|
12
README.md
12
README.md
@@ -1,14 +1,16 @@
|
||||
<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>
|
||||
|
||||
[forge port](https://github.com/sillyangel/mse-forge/)
|
||||
|
||||
[gitea repo](https://git.sillyangel.dev/angel/more-spear-enchants)
|
||||
|
||||
[github mirror](https://github.com/sillyangel/more-spear-enchants/)
|
||||
[Paper/Pupur/Folia port](https://git.sillyangel.dev/angel/mse-paper)
|
||||
|
||||
[forge port](https://git.sillyangel.dev/mse-forge/)
|
||||
|
||||
[curseforge page](https://www.curseforge.com/minecraft/mc-mods/more-spear-enchantments)
|
||||
|
||||
[modrinth page](https://modrinth.com/mod/more-spear-enchantments)
|
||||
[modrinth page](https://modrinth.com/mod/more-spear-enchantments)
|
||||
|
||||
[github mirror](https://github.com/sillyangel/more-spear-enchants/)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -26,19 +26,17 @@ public record CripplingEnchantmentEffect(LevelBasedValue duration) implements En
|
||||
if (target instanceof LivingEntity victim) {
|
||||
if (context.owner() != null && context.owner() instanceof Player player) {
|
||||
int Duration = (int) (this.duration.calculate(level) * 50); // Convert to ticks
|
||||
int slownessAmplifier = level - 1; // Level 1 = Slowness 0, Level 2 = Slowness I, Level 3 = Slowness II
|
||||
int weaknessAmplifier = level - 1; // Level 1 = Weakness 0, Level 2 = Weakness I, Level 3 = Weakness II
|
||||
victim.addEffect(new MobEffectInstance(
|
||||
MobEffects.SLOWNESS,
|
||||
Duration,
|
||||
slownessAmplifier,
|
||||
level,
|
||||
false,
|
||||
true
|
||||
));
|
||||
victim.addEffect(new MobEffectInstance(
|
||||
MobEffects.WEAKNESS,
|
||||
Duration,
|
||||
weaknessAmplifier,
|
||||
level,
|
||||
false,
|
||||
true
|
||||
));
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,13 +24,12 @@ public record PoisonEnchantmentEffect(LevelBasedValue duration) implements Encha
|
||||
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 poisonDuration = (int) (this.duration.calculate(level) * 40); // Convert to ticks
|
||||
int poisonAmplifier = level - 2; // Level 1 = Poison 0, Level 2 = Poison I, Level 3 = Poison II
|
||||
int poisonDuration = (int) (this.duration.calculate(level) * 50); // Convert to ticks
|
||||
|
||||
victim.addEffect(new MobEffectInstance(
|
||||
MobEffects.POISON,
|
||||
poisonDuration,
|
||||
poisonAmplifier,
|
||||
level,
|
||||
false,
|
||||
true
|
||||
));
|
||||
|
||||
@@ -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,13 +24,12 @@ 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 witherAmplifier = level - 2; // Level 1 = Wither 0, Level 2 = Wither I, Level 3 = Wither II
|
||||
int witherDuration = (int) (this.duration.calculate(level) * 50); // Convert to ticks
|
||||
|
||||
victim.addEffect(new MobEffectInstance(
|
||||
MobEffects.WITHER,
|
||||
witherDuration,
|
||||
witherAmplifier,
|
||||
level,
|
||||
false,
|
||||
true
|
||||
));
|
||||
|
||||
@@ -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": "爆炸"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"more_spear_enchantments:crippling",
|
||||
"more_spear_enchantments:poisoning",
|
||||
"more_spear_enchantments:thundering",
|
||||
"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,8 +1,10 @@
|
||||
modLoader = "javafml"
|
||||
loaderVersion = "[10,)"
|
||||
issueTrackerURL = "https://git.sillyangel.dev/angel/more-spear-enchants-neoforge/issues"
|
||||
issueTrackerURL = "https://git.sillyangel.dev/angel/more-spear-enchants/issues"
|
||||
updateJSONURL= "https://api.modrinth.com/updates/more-spear-enchantments/forge_updates.json"
|
||||
license = "MIT"
|
||||
|
||||
|
||||
[[mods]]
|
||||
modId = "more_spear_enchantments"
|
||||
version = "${version}"
|
||||
|
||||
11
update.json
Normal file
11
update.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"homepage": "https://modrinth.com/mod/more-spear-enchantments",
|
||||
"1.21.11": {
|
||||
"1.1.1": "added plugin support (paper, purpur, folia) - alpha\n- added new enchantments:\n - 🩸 vampiric - lifesteal on hit (I~III)\n - 💥 explosive - safe explosions on hit with chance and power scaling (I-III)\n- added 15 new translations (german, portuguese, italian, chinese, japanese, korean, russian, and more)\n- neoforge & forge only: switched update json to use the modrinth api instead of self hosted",
|
||||
"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.1",
|
||||
"1.21.11-recommended": "1.1.1"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user