Ok:
package com.shrexish.horsemod;
import org.apache.logging.log4j.LogManager;
import net.minecraftforge.event.entity.player.PlayerContainerEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
@Mod.EventBusSubscriber
public class EventHandler {
@SubscribeEvent
public static void containerOpen(PlayerContainerEvent.Open event) {
LogManager.getLogger();
}
}
This is my event handler. This is my main class:
package com.shrexish.horsemod;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
@Mod(Reference.MOD_ID)
public class HorseMod {
public HorseMod() {
MinecraftForge.EVENT_BUS.register(this);
FMLJavaModLoadingContext.get().getModEventBus().register(this);
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onClientSetup);
}
private void onClientSetup(FMLClientSetupEvent event) {
//PROXY.setupClient();
MinecraftForge.EVENT_BUS.register(new EventHandler());
}
}
This the ModItems class:
package com.shrexish.horsemod.init;
import com.shrexish.horsemod.Reference;
import com.shrexish.horsemod.item.ItemSaddleForTwo;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.registries.ObjectHolder;
@ObjectHolder(Reference.MOD_ID)
@Mod.EventBusSubscriber(modid = Reference.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
public class ModItems
{
public static final Item SADDLE_FOR_TWO = null;
@SubscribeEvent
@SuppressWarnings("unused")
public static void register(final RegistryEvent.Register<Item> event)
{
event.getRegistry().register(new ItemSaddleForTwo(new Item.Properties().maxStackSize(1).group(ItemGroup.TRANSPORTATION)));
}
}
This is the custom saddle class:
package com.shrexish.horsemod.item;
import com.shrexish.horsemod.Reference;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
public class ItemSaddleForTwo extends Item {
public ItemSaddleForTwo(Properties properties) {
super(properties);
this.setRegistryName(new ResourceLocation(Reference.MOD_ID, "saddle_for_two"));
}
}
This was practically everything.