Jump to content

I'm new to modding, can someone help me fix this 1.17 issue i found in mcjty's mod tutorial?


PogMan_15

Recommended Posts

I tried to follow along to his tutorial, but when I got to the end and tried to test it out for myself, it would not load properly. It keeps the same error messages, and none of Eclipse's quickfixes help or seem to affect anything whatsoever. I don't know what to do and would appreciate any help. The error message it gives is:

The method register(String, Supplier<? extends I>) in the type DeferredRegister<Item> is not applicable for the arguments (String, Supplier<capture#2-of ? extends I>)

 

Link to comment
Share on other sites

package com.Charlie.items;

import com.Charlie.items.TestItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Item.Properties;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.fmllegacy.RegistryObject;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;

import static com.Charlie.tutorial.Tutorial.MODID;

public class Registration {


	private static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MODID);
	
	public static void init() {
		ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
	}
	
	public static final RegistryObject<Item> TESTITEM = ITEMS.register("testitem", () -> new TestItem(new Item.Properties()))
	
}

Thats the registry code, do you need any of the other code?

Link to comment
Share on other sites

Firstly you forgot the semicolon at the end of this line 

public static final RegistryObject<Item> TESTITEM = ITEMS.register("testitem", () -> new TestItem(new Item.Properties()))

The second thing:

In this line here:

private static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MODID);

You are using the variable MODID but you have never created it.

You need to create it like this:

public static final String MODID = "<your modid>";

Then it should work

Edited by MrMarnic
Link to comment
Share on other sites

It did not work. I think that the errors are in line 23, this one right here

public static final RegistryObject<Item> TESTITEM = ITEMS.register("testitem", () -> new TestItem(new Item.Properties()));

it has an error line underneath register that says "The method register(String, Supplier<? extends I>) in the type DeferredRegister<Item> is not applicable for the arguments (String, Supplier<capture#2-of ? extends I>)"

And the Error line underneath TestItem says that "TestItem cannot be resolved to a type"

Link to comment
Share on other sites

package com.Charlie.items;

import net.minecraft.world.item.Item;

public class TestItem extends Item{

	public TestItem(Properties properties) {
		super(properties);
		// TODO Auto-generated constructor stub
	}

}

There is the TestItem class, and i even made sure to import it into the Registration file, which is why I am so confused. There is an error line beneath the part where I imported the class that says that that import is unused. 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I downgraded it and got this: 10:51:24.876 at cpw.mods.securejarhandler@1.0.3/cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:132) 10:51:24.876 at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) 10:51:24.876 at java.base/java.lang.ClassLoader.defineClass1(Native Method) 10:51:24.876 at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012) 10:51:24.876 at cpw.mods.securejarhandler@1.0.3/cpw.mods.cl.ModuleClassLoader.readerToClass(ModuleClassLoader.java:116) 10:51:24.876 at cpw.mods.securejarhandler@1.0.3/cpw.mods.cl.ModuleClassLoader.lambda$findClass$16(ModuleClassLoader.java:216) 10:51:24.876 at cpw.mods.securejarhandler@1.0.3/cpw.mods.cl.ModuleClassLoader.loadFromModule(ModuleClassLoader.java:226) 10:51:24.876 at cpw.mods.securejarhandler@1.0.3/cpw.mods.cl.ModuleClassLoader.findClass(ModuleClassLoader.java:216) 10:51:24.876 at cpw.mods.securejarhandler@1.0.3/cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:132) 10:51:24.876 at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) 10:51:24.876 at TRANSFORMER/patchouli@1.18.2-71.1/vazkii.patchouli.client.handler.BookCrashHandler.appendToCrashReport(BookCrashHandler.java:23) 10:51:24.876 at TRANSFORMER/minecraft@1.18.2/net.minecraft.SystemReport.handler$cbk000$patchouli_addContext(SystemReport.java:1016) 10:51:24.876 at TRANSFORMER/minecraft@1.18.2/net.minecraft.SystemReport.<init>(SystemReport.java:57) 10:51:24.876 at TRANSFORMER/minecraft@1.18.2/net.minecraft.CrashReport.<init>(CrashReport.java:29) 10:51:24.876 at TRANSFORMER/minecraft@1.18.2/net.minecraft.CrashReport.m_127529_(CrashReport.java:213) 10:51:24.876 at TRANSFORMER/minecraft@1.18.2/net.minecraft.client.main.Main.main(Main.java:137) 10:51:24.876 ... 13 more 10:51:24.876 Caused by: org.spongepowered.asm.mixin.throwables.MixinApplyError: Mixin [inventorio.mixins.json:PlayerEntityMixin] from phase [DEFAULT] in config [inventorio.mixins.json] FAILED during APPLY 10:51:24.876 at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinProcessor.handleMixinError(MixinProcessor.java:636) 10:51:24.876 at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinProcessor.handleMixinApplyError(MixinProcessor.java:588) 10:51:24.876 at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:379) 10:51:24.876 ... 40 more 10:51:24.876 Caused by: org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException: @At("INVOKE") on net/minecraft/world/entity/player/Player::inventorioEquipMainHand with priority 1000 cannot inject into net/minecraft/world/entity/player/Player::m_8061_(Lnet/minecraft/world/entity/EquipmentSlot;Lnet/minecraft/world/item/ItemStack;)V merged by com.abdelaziz.canary.mixin.calc.if_else.player_slot.PlayerMixin with priority 1000 [PREINJECT Applicator Phase -> inventorio.mixins.json:PlayerEntityMixin -> Prepare Injections -> -> redirect$ben000$inventorioEquipMainHand(Lnet/minecraft/core/NonNullList;ILjava/lang/Object;)Ljava/lang/Object; -> Prepare] 10:51:24.876 at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.injection.code.Injector.findTargetNodes(Injector.java:305)
    • Hiya! I've just been using FTB Launcher there since I was having problems with Curseforge and now I've run into bother with this as well. It began out of nowhere but whenever I was trying to load AllTheMods 8 one day it didn't work so I deleted the config for some broken mods; usually works for me. Nothing worked so I uninstalled the whole instance, and I've been redownloading it again and again trying different things - Allocating more ram, reinstalling Java, the works.   It'd be greatly appreciated if anyone were able to help me, every couple of weeks I have to tear these modpacks apart to actually get them to work and it's so annoying.   Here's the log if that helps? The guy on the other post said to post the whole debug but I couldn't get it: https://ibb.co/5G03gX4 Sorry that it's linked it wouldn't let me copy and paste, the newest debug will be below too:   [09Jun2023 15:31:10.155] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--username, SillyDillyXoxo, --version, 1.19.2-forge-43.2.11, --gameDir, D:\ftb\c4f3a60c-f9e7-49d8-970a-17b98825359e, --assetsDir, C:\Users\Dylan Lunney\AppData\Local\.ftba\bin\assets, --assetIndex, 1.19, --uuid, cef43407-3d1e-48f8-96a5-ec6b2b30a9a9, --accessToken, ????????, --clientId, ${clientid}, --xuid, ${auth_xuid}, --userType, msa, --versionType, release, --width, 1720, --height, 840, --launchTarget, forgeclient, --fml.forgeVersion, 43.2.11, --fml.mcVersion, 1.19.2, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20220805.130853] [09Jun2023 15:31:10.160] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 10.0.8+10.0.8+main.0ef7e830 starting: java version 17.0.4 by Eclipse Adoptium; OS Windows 10 arch amd64 version 10.0 [09Jun2023 15:31:10.180] [main/DEBUG] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Found launch services [fmlclientdev,forgeclient,minecraft,forgegametestserverdev,fmlserveruserdev,fmlclient,fmldatauserdev,forgeserverdev,forgeserveruserdev,forgeclientdev,forgeclientuserdev,forgeserver,forgedatadev,fmlserver,fmlclientuserdev,fmlserverdev,forgedatauserdev,testharness,forgegametestserveruserdev] [09Jun2023 15:31:10.190] [main/DEBUG] [cpw.mods.modlauncher.NameMappingServiceHandler/MODLAUNCHER]: Found naming services : [srgtomcp] [09Jun2023 15:31:10.203] [main/DEBUG] [cpw.mods.modlauncher.LaunchPluginHandler/MODLAUNCHER]: Found launch plugins: [mixin,eventbus,slf4jfixer,object_holder_definalize,runtime_enum_extender,capability_token_subclass,accesstransformer,runtimedistcleaner] [09Jun2023 15:31:10.211] [main/DEBUG] [cpw.mods.modlauncher.TransformationServicesHandler/MODLAUNCHER]: Discovering transformation services        
    • Are you tired of “modern” skyblock servers that are nothing like the original? Are you looking for a skyblock server that is just like the original skyblock servers used to be? So was I, but I couldn't find one, so, I decided to make my own. Many modern servers have mutated the Skyblock game mode to the point where it is unrecognizable compared to the original. We are seeking to create a space where those who loved classic Skyblock can enjoy the original game mode. Even if you have not played classic Skyblock before, we encourage you to join our community to learn about what the original mode was like and why there was so much excitement around it. Server Description Classic Skies is designed just like the original skyblock servers but in the modern version, 1.19.4. There is a server shop where you can buy some of the items that you can’t obtain naturally with in-game money, as well as a plugin that allows you to set up your own shops on your island, causing a mostly player-run economy. Classic Skies’ goal is to bring back the nostalgic and classic feel of the original Skyblock as much as possible. We have a dedicated staff team and an owner with years of experience running small to medium-sized Minecraft servers. Classic Skies is a small server with a tight-knit community, and we are looking for new members to enjoy our server. Additionally, we are dedicated to delivering a lag-free, fair, and safe experience for every member of the community. Server Info Server IP: play.classicskies.com Supports Java & Bedrock Edition Bedrock Port: 19132 Game Version: 1.19.4 Discord: https://discord.gg/n7qXHnhksA
    • https://gist.github.com/Jayv6/7e39a9c1b3eb10b0d5d76442718d80e0
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.