
Diglis
Members-
Posts
10 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Diglis's Achievements

Tree Puncher (2/8)
0
Reputation
-
@SubscribeEvent public static void onClickEvent(InputEvent.ClickInputEvent event) { PlayerEntity player = Minecraft.getInstance().player; World world = Minecraft.getInstance().level; assert player != null; if(event.getKeyBinding().matchesMouse(0) && player.isHolding(ItemInit.ANDEN.get())) { if(!world.isClientSide) { for(int i = (int) player.getY(); i > 0; i--) { world.explode(player, player.getX(), i, player.getZ(), 5.5f, Explosion.Mode.DESTROY); } } } } I've been trying all night to get this to work without leaving ghost blocks, but for some reason, world.isClientSide() always returns true, and I can't figure out why.
-
java.util.concurrent.ExecutionException: net.minecraft.util.ResourceLocationException: Non [a-z0-9/._-] character in path of location: eldencraft:eldencraft:short_sword_1 at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357) ~[?:1.8.0_362] at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1908) ~[?:1.8.0_362] at net.minecraft.client.Minecraft.makeServerStem(Minecraft.java:1866) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.client.Minecraft.loadWorld(Minecraft.java:1714) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.client.Minecraft.loadLevel(Minecraft.java:1683) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.client.gui.screen.WorldSelectionList$Entry.loadWorld(WorldSelectionList.java:364) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.client.gui.screen.WorldSelectionList$Entry.joinWorld(WorldSelectionList.java:273) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.client.gui.screen.WorldSelectionList$Entry.mouseClicked(WorldSelectionList.java:228) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.client.gui.widget.list.AbstractList.mouseClicked(AbstractList.java:309) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.client.gui.INestedGuiEventHandler.mouseClicked(INestedGuiEventHandler.java:28) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.client.MouseHelper.lambda$onPress$0(MouseHelper.java:87) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.client.gui.screen.Screen.wrapScreenError(Screen.java:427) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.client.MouseHelper.onPress(MouseHelper.java:85) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.client.MouseHelper.lambda$null$4(MouseHelper.java:181) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.util.concurrent.ThreadTaskExecutor.execute(ThreadTaskExecutor.java:86) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.client.MouseHelper.lambda$setup$5(MouseHelper.java:180) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:36) ~[lwjgl-glfw-3.2.2.jar:build 10] at org.lwjgl.system.JNI.invokeV(Native Method) ~[lwjgl-3.2.2.jar:build 10] at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3101) ~[lwjgl-glfw-3.2.2.jar:build 10] at com.mojang.blaze3d.systems.RenderSystem.flipFrame(RenderSystem.java:93) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.client.MainWindow.updateDisplay(MainWindow.java:306) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.client.Minecraft.runTick(Minecraft.java:997) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.client.Minecraft.run(Minecraft.java:607) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_362] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_362] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_362] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_362] at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.1.3.jar:?] at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.1.3.jar:?] at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.1.3.jar:?] at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.1.3.jar:?] at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.1.3.jar:?] at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:108) [forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] Caused by: net.minecraft.util.ResourceLocationException: Non [a-z0-9/._-] character in path of location: eldencraft:eldencraft:short_sword_1 at net.minecraft.util.ResourceLocation.<init>(ResourceLocation.java:33) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.util.ResourceLocation.<init>(ResourceLocation.java:38) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.item.crafting.Ingredient.valueFromJson(Ingredient.java:214) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraftforge.common.crafting.VanillaIngredientSerializer.parse(VanillaIngredientSerializer.java:41) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraftforge.common.crafting.CraftingHelper.getIngredient(CraftingHelper.java:155) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.item.crafting.Ingredient.fromJson(Ingredient.java:189) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.item.crafting.SmithingRecipe$Serializer.fromJson(SmithingRecipe.java:70) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.item.crafting.SmithingRecipe$Serializer.fromJson(SmithingRecipe.java:68) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.item.crafting.RecipeManager.fromJson(RecipeManager.java:141) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.item.crafting.RecipeManager.apply(RecipeManager.java:61) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.item.crafting.RecipeManager.apply(RecipeManager.java:38) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.client.resources.ReloadListener.lambda$reload$1(ReloadListener.java:14) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at java.util.concurrent.CompletableFuture.uniAccept(CompletableFuture.java:670) ~[?:1.8.0_362] at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:646) ~[?:1.8.0_362] at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:456) ~[?:1.8.0_362] at net.minecraft.resources.AsyncReloader.lambda$null$3(AsyncReloader.java:66) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.util.concurrent.ThreadTaskExecutor.doRunTask(ThreadTaskExecutor.java:136) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.util.concurrent.RecursiveEventLoop.doRunTask(RecursiveEventLoop.java:22) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.util.concurrent.ThreadTaskExecutor.pollTask(ThreadTaskExecutor.java:109) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.util.concurrent.ThreadTaskExecutor.managedBlock(ThreadTaskExecutor.java:119) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] at net.minecraft.client.Minecraft.makeServerStem(Minecraft.java:1865) ~[forge-1.16.5-36.2.34_mapped_official_1.16.5-recomp.jar:?] ... 32 more Added a large amount of new items, when one of them caused this. I've checked all of the JSON files for any invalid characters but i couldnt find any. Here's the repo to my mod https://github.com/DiglisTheIII/Elden_Craft
-
public enum PickaxeToolMaterial implements IItemTier { TITANIUM_PICKAXE(4, 10000, 100f, 5f, 17, () -> Ingredient.of(ItemInit.PURE_TITANIUM.get())), ENERGY_SWORD(4, 100, 5f, 20f, 0, () -> Ingredient.of(ItemInit.PURE_TITANIUM.get())), GRAVITY_HAMMER(4, 7000, 1f, 9.6f, 17, () -> Ingredient.of(ItemInit.PURE_TITANIUM.get())); private final int harvestLevel; private final int maxUses; private final float efficiency; private final float attackDamage; private final int enchantability; private final Ingredient repairMaterial; PickaxeToolMaterial(int harvestLevel, int maxUses, float efficiency, float attackDamage, int enchantability, Supplier<Ingredient> repairMaterial) { this.harvestLevel = harvestLevel; this.maxUses = maxUses; this.efficiency = efficiency; this.attackDamage = attackDamage; this.enchantability = enchantability; this.repairMaterial = repairMaterial.get(); } @Override public int getUses() { // TODO Auto-generated method stub return this.maxUses; } @Override public float getSpeed() { // TODO Auto-generated method stub return this.efficiency; } @Override public float getAttackDamageBonus() { // TODO Auto-generated method stub return this.attackDamage; } @Override public int getLevel() { // TODO Auto-generated method stub return this.harvestLevel; } @Override public int getEnchantmentValue() { // TODO Auto-generated method stub return this.enchantability; } @Override public Ingredient getRepairIngredient() { // TODO Auto-generated method stub return this.repairMaterial; } } this is the class i use to actually set the values
-
Yes, I am just very new to the forge api, and you are being rather vague. I am guessing getAttribute is a method you can use (with dot notation) but I am not sure as to where to apply it in my code.
-
Ok i created a new class like this: package com.diglis.halowip.common; import net.minecraft.entity.ai.attributes.Attribute; import net.minecraft.item.Item; public class weaponAttributes extends Item { public weaponAttributes(Properties p_i48487_1_) { super(p_i48487_1_); // TODO Auto-generated constructor stub } public Attribute getAttribute() { return null; } } Is this right or am i all wrong?
-
package com.diglis.halowip.core.init; import com.diglis.halowip.HaloWip; import com.diglis.halowip.common.CustomArmorMaterial; import com.diglis.halowip.common.PickaxeToolMaterial; import com.diglis.halowip.core.itemgroup.HaloModItemGroupArmor; import com.diglis.halowip.core.itemgroup.HaloModItemGroupMisc; import com.diglis.halowip.core.itemgroup.HaloModItemGroupWeapons; import net.minecraft.entity.ai.attributes.Attribute; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.item.ArmorItem; import net.minecraft.item.AxeItem; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.PickaxeItem; import net.minecraft.item.SwordItem; import net.minecraft.util.IItemProvider; import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; public class ItemInit { public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, HaloWip.MOD_ID); public static final RegistryObject<Item> ASSAULT_RIFLE = ITEMS.register("assault_rifle", () -> new Item(new Item.Properties().tab(HaloModItemGroupWeapons.HALO_CRAFTING_EVOLVED))); public static final RegistryObject<Item> RIFLE_AMMO = ITEMS.register("ammo_pouch", () -> new Item(new Item.Properties().tab(HaloModItemGroupWeapons.HALO_CRAFTING_EVOLVED))); public static final RegistryObject<Item> RAW_TITANIUM = ITEMS.register("raw_titanium", () -> new Item(new Item.Properties().tab(HaloModItemGroupMisc.HALO_CRAFTING_EVOLVED))); public static final RegistryObject<Item> PURE_TITANIUM = ITEMS.register("pure_titanium", () -> new Item(new Item.Properties().tab(HaloModItemGroupMisc.HALO_CRAFTING_EVOLVED).fireResistant())); public static final RegistryObject<Item> TITANIUM_PICKAXE = ITEMS.register("titanium_pickaxe", () -> new PickaxeItem(CustomToolMaterial.TITANIUM_PICKAXE, 10, -1f, new Item.Properties().tab(HaloModItemGroupWeapons.HALO_CRAFTING_EVOLVED))); public static final RegistryObject<Item> GRAVITY_HAMMER = ITEMS.register("gravity_hammer", () -> new AxeItem(CustomToolMaterial.GRAVITY_HAMMER, 7, -1f, new Item.Properties().tab(HaloModItemGroupWeapons.HALO_CRAFTING_EVOLVED))); public static final RegistryObject<Item> ENERGY_SWORD = ITEMS.register("energy_sword", () -> new SwordItem(CustomToolMaterial.ENERGY_SWORD, 5, -1f, new Item.Properties().tab(HaloModItemGroupWeapons.HALO_CRAFTING_EVOLVED).setNoRepair())); public static final RegistryObject<Item> MASTER_CHIEF_HELMET = ITEMS.register("mk6_helm", () -> new ArmorItem(CustomArmorMaterial.MK6_ARMOR, EquipmentSlotType.HEAD, new Item.Properties().tab(HaloModItemGroupArmor.HALO_CRAFTING_EVOLVED).fireResistant())); public static final RegistryObject<Item> MASTER_CHIEF_CHEST = ITEMS.register("mk6_chest", () -> new ArmorItem(CustomArmorMaterial.MK6_ARMOR, EquipmentSlotType.CHEST, new Item.Properties().tab(HaloModItemGroupArmor.HALO_CRAFTING_EVOLVED).fireResistant())); public static final RegistryObject<Item> MASTER_CHIEF_LEGGINGS = ITEMS.register("mk6_legs", () -> new ArmorItem(CustomArmorMaterial.MK6_ARMOR, EquipmentSlotType.LEGS, new Item.Properties().tab(HaloModItemGroupArmor.HALO_CRAFTING_EVOLVED).fireResistant())); public static final RegistryObject<Item> MASTER_CHIEF_BOOTS = ITEMS.register("mk6_boots", () -> new ArmorItem(CustomArmorMaterial.MK6_ARMOR, EquipmentSlotType.FEET, new Item.Properties().tab(HaloModItemGroupArmor.HALO_CRAFTING_EVOLVED).fireResistant())); public static final RegistryObject<Item> TRANSPARENT_MK6_HELM = ITEMS.register("mk6_clear", () -> new ArmorItem(CustomArmorMaterial.NOVISR_MK6_HELM, EquipmentSlotType.HEAD, new Item.Properties().tab(HaloModItemGroupArmor.HALO_CRAFTING_EVOLVED))); public static final RegistryObject<Item> BLUE_MK6_HELM = ITEMS.register("mk6_blue", () -> new ArmorItem(CustomArmorMaterial.BLUE_MK6_HELM, EquipmentSlotType.HEAD, new Item.Properties().tab(HaloModItemGroupArmor.HALO_CRAFTING_EVOLVED).fireResistant())); } would it be in this class?
-
Oh and i neglected to mention that I am in 1.16.5, which i know has a lot parity with older versions
-
i am not very good with this, where would i add it? my ItemsInit class or CustomWeaponsMaterial class?
-
Diglis joined the community
-
Ok, so I have been trying for a while now to add knockback to an item I have modded in when it is crafted. I have seen people say to edit the .json recipe file like this: { "type": "minecraft:crafting_shaped", "pattern": [ "PPP", "PSI", "PSI" ], "key": { "P": { "item": "halowip:pure_titanium" }, "S": { "item": "minecraft:stick" }, "I": { "item": "minecraft:iron_ingot" } }, "result": { "item": "minecraft:gravity_hammer", "nbt": { "ench": [ { "id": "minecraft:knockback", "lvl": 99 } ] }, "count": 1 } } but it does not seem to work. I have also tried creating an enchantment class, but that doesn't work since I have my items purely under RegistryObject and not ItemStack (I may be stupid, feel free to correct me). I also have a github repo for my project for anyone who wants to look at it (it needs to be updated from about a day ago). Any help is appreciated!!!