File Details
powered-exoskeleton-1.0.0_a.jar
- B
- May 5, 2025
- 40.30 KB
- 4
- 1.21.1
- Fabric
File Name
powered-exoskeleton-1.0.0_a.jar
Supported Versions
- 1.21.1
Curse Maven Snippet
reporter:To avoid potential discrepancies with the intended meaning, no English changelog is provided here. Please translate it yourself.
MOD名称:Powered Exoskeleton
MOD_ID:powered-exoskeleton
开发者:J_pc(中国大陆,PRC)
MOD内容:
新增物品:
powered-exoskeleton:head_exoskeleton
powered-exoskeleton:torso_exoskeleton
powered-exoskeleton:legs_exoskeleton
powered-exoskeleton:feet_exoskeleton
新增方块:NONE
新增生物实体:NONE
新增弹射物实体:NONE
新增命令:NONE
新增结构:NONE
新增地物:NONE
新增维度:NONE
新增生物群系:NONE
powered-exoskeleton:head_exoskeleton
最大堆叠数量:1
获取方式:合成
用途:装备于头盔位,使玩家获得夜视效果
护甲值:2
盔甲韧性:6
击退抗性:0
相关代码:
package com.example.item.custom;
import net.minecraft.entity.Entity;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.item.ItemStack;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.world.World;
public class ModHEArmorItem extends ArmorItem {
private static final StatusEffectInstance H_E_Effect =
new StatusEffectInstance(StatusEffects.NIGHT_VISION, 210, 0, false, false);
public ModHEArmorItem(RegistryEntry<ArmorMaterial> material, Type type, Settings settings) {
super(material, type, settings);
}
private void applyNightVisionEffect(PlayerEntity player) {
player.addStatusEffect(new StatusEffectInstance(H_E_Effect));
}
private boolean isWearingExoskeletonHelmet(PlayerEntity player) {
ItemStack headSlot = player.getInventory().getArmorStack(3);
return !headSlot.isEmpty() &&
headSlot.getItem() == this &&
((ArmorItem)headSlot.getItem()).getMaterial() == this.material;
}
@Override
public void inventoryTick(ItemStack stack, World world, Entity entity, int slot, boolean selected) {
super.inventoryTick(stack, world, entity, slot, selected);
if (!world.isClient &&
entity instanceof PlayerEntity player &&
slot == 3) {
if (isWearingExoskeletonHelmet(player)) {
applyNightVisionEffect(player);
}
}
}
}
--
{
"type": "minecraft:crafting_shaped",
"category": "equipment",
"key": {
"#": {
"item": "minecraft:iron_ingot"
},
"*": {
"item": "minecraft:redstone"
}
},
"pattern": [
" ",
"###",
"#*#"
],
"result": {
"count": 1,
"id": "powered-exoskeleton:head_exoskeleton"
}
}
powered-exoskeleton:feet_exoskeleton
最大堆叠数量:1
获取方式:合成
用途:装备于靴子位,使玩家获得速度3效果
护甲值:2
盔甲韧性:6
击退抗性:0
相关代码:
package com.example.item.custom;
import net.minecraft.entity.Entity;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.item.ItemStack;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.world.World;
public class ModFEArmorItem extends ArmorItem {
private static final StatusEffectInstance F_E_Effect =
new StatusEffectInstance(StatusEffects.SPEED, 10, 2, false, false);
public ModFEArmorItem(RegistryEntry<ArmorMaterial> material, Type type, Settings settings) {
super(material, type, settings);
}
private void applyNightVisionEffect(PlayerEntity player) {
player.addStatusEffect(new StatusEffectInstance(F_E_Effect));
}
private boolean isWearingExoskeletonHelmet(PlayerEntity player) {
ItemStack headSlot = player.getInventory().getArmorStack(0);
return !headSlot.isEmpty() &&
headSlot.getItem() == this &&
((ArmorItem)headSlot.getItem()).getMaterial() == this.material;
}
@Override
public void inventoryTick(ItemStack stack, World world, Entity entity, int slot, boolean selected) {
super.inventoryTick(stack, world, entity, slot, selected);
if (!world.isClient &&
entity instanceof PlayerEntity player &&
slot == 0) {
if (isWearingExoskeletonHelmet(player)) {
applyNightVisionEffect(player);
}
}
}
}
--
{
"type": "minecraft:crafting_shaped",
"category": "equipment",
"key": {
"#": {
"item": "minecraft:iron_ingot"
},
"*": {
"item": "minecraft:redstone"
}
},
"pattern": [
" ",
"#*#",
"# #"
],
"result": {
"count": 1,
"id": "powered-exoskeleton:feet_exoskeleton"
}
}
powered-exoskeleton:torso_exoskeleton
最大堆叠数量:1
获取方式:合成
用途:装备于胸甲位
护甲值:4
盔甲韧性:6
击退抗性:0
相关代码:
{
"type": "minecraft:crafting_shaped",
"category": "equipment",
"key": {
"#": {
"item": "minecraft:iron_ingot"
},
"*": {
"item": "minecraft:redstone_block"
}
},
"pattern": [
"# #",
"#*#",
"###"
],
"result": {
"count": 1,
"id": "powered-exoskeleton:torso_exoskeleton"
}
}
powered-exoskeleton:legs_exoskeleton
最大堆叠数量:1
获取方式:合成
用途:装备于护腿位
护甲值:3
盔甲韧性:6
击退抗性:0
相关代码:
{
"type": "minecraft:crafting_shaped",
"category": "equipment",
"key": {
"#": {
"item": "minecraft:iron_ingot"
},
"*": {
"item": "minecraft:redstone"
}
},
"pattern": [
"###",
"#*#",
"# #"
],
"result": {
"count": 1,
"id": "powered-exoskeleton:legs_exoskeleton"
}
}
盔甲注册方法:
package com.example.item;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.item.ItemConvertible;
import net.minecraft.recipe.Ingredient;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.sound.SoundEvent;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Identifier;
import net.minecraft.util.Util;
import java.util.EnumMap;
import java.util.List;
import java.util.function.Supplier;
public class ModArmorMaterials {
public static final RegistryEntry<ArmorMaterial> EXOSKELETON = register("exoskeleton", Util.make(new EnumMap(ArmorItem.Type.class), map -> {
map.put(ArmorItem.Type.BOOTS, 2);
map.put(ArmorItem.Type.LEGGINGS, 3);
map.put(ArmorItem.Type.CHESTPLATE, 4);
map.put(ArmorItem.Type.HELMET, 2);
map.put(ArmorItem.Type.BODY, 11);
}), 15, SoundEvents.ITEM_ARMOR_EQUIP_NETHERITE, 6.0F, 0, () -> Ingredient.ofItems((ItemConvertible) null));
private static RegistryEntry<ArmorMaterial> register(
String id,
EnumMap<ArmorItem.Type, Integer> defense,
int enchantability,
RegistryEntry<SoundEvent> equipSound,
float toughness,
float knockbackResistance,
Supplier<Ingredient> repairIngredient
) {
List<ArmorMaterial.Layer> list = List.of(new ArmorMaterial.Layer(Identifier.ofVanilla(id)));
return register(id, defense, enchantability, equipSound, toughness, knockbackResistance, repairIngredient, list);
}
private static RegistryEntry<ArmorMaterial> register(
String id,
EnumMap<ArmorItem.Type, Integer> defense,
int enchantability,
RegistryEntry<SoundEvent> equipSound,
float toughness,
float knockbackResistance,
Supplier<Ingredient> repairIngredient,
List<ArmorMaterial.Layer> layers
) {
EnumMap<ArmorItem.Type, Integer> enumMap = new EnumMap(ArmorItem.Type.class);
for (ArmorItem.Type type : ArmorItem.Type.values()) {
enumMap.put(type, (Integer)defense.get(type));
}
return Registry.registerReference(
Registries.ARMOR_MATERIAL,
Identifier.ofVanilla(id),
new ArmorMaterial(enumMap, enchantability, equipSound, repairIngredient, layers, toughness, knockbackResistance)
);
}
}
--
package com.example.item;
import com.example.PoweredExoskeleton;
import com.example.item.custom.ModFEArmorItem;
import com.example.item.custom.ModHEArmorItem;
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroupEntries;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroups;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;
public class ModItems {
public static final Item HEAD_EXOSKELETON = registerItems("head_exoskeleton", new ModHEArmorItem(ModArmorMaterials.EXOSKELETON,ArmorItem.Type.HELMET, new Item.Settings().maxCount(1)));
public static final Item TORSO_EXOSKELETON = registerItems("torso_exoskeleton", new ArmorItem(ModArmorMaterials.EXOSKELETON,ArmorItem.Type.CHESTPLATE, new Item.Settings().maxCount(1)));
public static final Item LEGS_EXOSKELETON = registerItems("legs_exoskeleton", new ArmorItem(ModArmorMaterials.EXOSKELETON,ArmorItem.Type.LEGGINGS, new Item.Settings().maxCount(1)));
public static final Item FEET_EXOSKELETON = registerItems("feet_exoskeleton", new ModFEArmorItem(ModArmorMaterials.EXOSKELETON,ArmorItem.Type.BOOTS, new Item.Settings().maxCount(1)));
public static Item registerItems(String id, Item item) {
return Registry.register(Registries.ITEM, Identifier.of(PoweredExoskeleton.MOD_ID, id), item);
}
public static void addItemsToItemGroup_COMBAT(FabricItemGroupEntries fabricItemGroupEntries) {
fabricItemGroupEntries.add(HEAD_EXOSKELETON);
fabricItemGroupEntries.add(TORSO_EXOSKELETON);
fabricItemGroupEntries.add(LEGS_EXOSKELETON);
fabricItemGroupEntries.add(FEET_EXOSKELETON);
}
public static void registerModItems() {
ItemGroupEvents.modifyEntriesEvent(ItemGroups.COMBAT).register(ModItems::addItemsToItemGroup_COMBAT);
}
}
经测试,此版本目前未发现异常;
预计在下一个beta版中更改的内容:添加powered-exoskeleton:legs_exoskeleton与powered-exoskeleton:torso_exoskeleton的贴图;添加powered-exoskeleton:legs_exoskeleton与powered-exoskeleton:torso_exoskeleton装备时的效果
报告人:J_pc(中国大陆,PRC)
报告时间:2025/5/2/15:33(东八区)
MOD创建时期:2025/4/18/20:38(东八区)
MOD版本:1.0.0_a
MOD编写时的联网状态:个人网
MOD适用的Minecraft版本:《Minecraft JAVA 1.21.1-Fabric 0.16.10-Fabric API 0.115.1 Edition》
MOD适用的模组加载器版本:Fabric 0.16.13+ &Fabric API 0.97.8+
MOD当前版本完成时期:2025/5/2/15:10(东八区)
MOD当前版本测试完成时期:2025/5/2/13:09(东八区)
MOD编写时使用的操作系统:Windows10.0.19042.746
MOD编写时使用的中央处理器:Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz 2.40 GHz
MOD编写时使用的显卡:集成显卡
MOD编写时使用的JAVA解释器:JDK 21.0.4
MOD编写时使用的映射:yarn映射
MOD测试时使用的启动器:Fabric Launcher
MOD测试时的联网状态:个人网
MOD测试时的登录方式:离线登录
MOD测试时使用的JAVA解释器:JDK 21.0.4
MOD测试时使用的Minecraft源:镜像源
MOD测试时的版本隔离:隔离所有版本
MOD测试时的JAVA虚拟机参数头:-XX:+UseG1GC -XX:-UseAdaptiveSizePolicy -XX:-OmitStackTraceInFastThrow -Dfml.ignoreInvalidMinecraftCertificates=True -Dfml.ignorePatchDiscrepancies=True -Dlog4j2.formatMsgNoLookups=true
JAVA虚拟机参数尾:
MOD测试时使用的Minecraft版本:《Minecraft JAVA 1.21.1-Fabric 0.16.13 Edition》
MOD测试时使用的前置MOD:Fabric API-0.115.4