Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hey all.  I finally got everything working and building with this tutorial (https://cadiboo.github.io/tutorials/1.14.4/forge/) however I can't get an item to appear.  From what I can tell, I've followed the tutorial exactly save for a few things I modified to match someone else's code a bit who was asking the same question I was but his problem was that he was registering to the wrong eventbus.  

Anyone have any thoughts?

 

Main.java:


import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import net.minecraftforge.fml.common.Mod;

@Mod(Main.MODID)
public final class Main {

	public static final String MODID = "itemtest1";
	
	public static final Logger LOGGER = LogManager.getLogger();
	
	public Main() {

		LOGGER.debug("TEST TEST");
	}
}

 

ModEventSubscriber.java:

import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.registries.IForgeRegistryEntry;

@Mod.EventBusSubscriber(modid = Main.MODID, bus = Mod.EventBusSubscriber.Bus.MOD)
public final class ModEventSubscriber {

	@SubscribeEvent
	public static void onRegisterItems(RegistryEvent.Register<Item> event) {
		event.getRegistry().registerAll(
				setup(new Item(new Item.Properties()), "testitem")
				);
	}
	
	public static <T extends IForgeRegistryEntry<T>> T setup(final T entry, final String name) {
		return setup(entry, new ResourceLocation(Main.MODID, name));
	}

	public static <T extends IForgeRegistryEntry<T>> T setup(final T entry, final ResourceLocation registryName) {
		entry.setRegistryName(registryName);
		return entry;
	}
}

 

From what I can tell, everything here should be accurate and correct.  However, when I load into a newly created world and try to type /give Dev testitem I get an error that it's not found.  

Edited by Profinger

3 minutes ago, Profinger said:

From what I can tell, everything here should be accurate and correct.  However, when I load into a newly created world and try to type /give Dev testitem I get an error that it's not found.  

Have you tried "modid:testitem"?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

  • Author

Good lord..  That was the ticket lol Thank you so much!  I hadn't actually seen any examples anywhere of the proper give command and I'm only really familiar with using /give in vanilla since I've never modded or really played with mods before.  Minecraft kept autocompleting with /give Dev minecraft: things and just leaving the minecraft: designation off didn't help.  I didn't realize I access them directly through my modid!

 

Thank you!

Edited by Profinger

9 minutes ago, Profinger said:

I didn't realize I access them directly through my modid!

The "minecraft: at the beginning IE "minecraft:diamond_pickaxe" is the modid for vanilla stuff.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.