-
Is there a way to edit a horse's inventory to allow my custom saddle to be placed in its inventory?
Thanks so much! I can now use my custom saddle on my horse. Now I will research how I can add to player functionality on the saddle. I think this doesn't have to do with the saddle, but with the horse itself not accepting two players. I'm really learning a lot right now, thanks!
-
Is there a way to edit a horse's inventory to allow my custom saddle to be placed in its inventory?
Hey ZDoctor! Im reading your comment now. Thanks!
-
Is there a way to edit a horse's inventory to allow my custom saddle to be placed in its inventory?
Once I just do LogManager.getLogger().log(Level.INFO, "HorseInventory Opened!"); It prints that when I open my inventory when im on the horse. Off the horse and I open my inventory it doesnt print. So now i can know when the player opens the horse inventory. Now i just need to add my saddle to be able to be placed on horses. Hard part.
-
Is there a way to edit a horse's inventory to allow my custom saddle to be placed in its inventory?
Thanks! I will try these out!
-
Is there a way to edit a horse's inventory to allow my custom saddle to be placed in its inventory?
Still can't find a solution to this. Do you have any more recommendations?
-
Is there a way to edit a horse's inventory to allow my custom saddle to be placed in its inventory?
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.
-
Is there a way to edit a horse's inventory to allow my custom saddle to be placed in its inventory?
Still nothing printing out.
-
Is there a way to edit a horse's inventory to allow my custom saddle to be placed in its inventory?
Im trying the first way, hope it works!
-
Is there a way to edit a horse's inventory to allow my custom saddle to be placed in its inventory?
Switching to Logger didn't give out any info. Any other recommendation?
-
Is there a way to edit a horse's inventory to allow my custom saddle to be placed in its inventory?
I'm just using @SubscribeEvent. I will switch to Logger.
-
Is there a way to edit a horse's inventory to allow my custom saddle to be placed in its inventory?
Hey! After trying to understand what this PlayerContainerEvent.Open does, I did this: @SubscribeEvent public void containerOpen(PlayerContainerEvent.Open event) { System.out.println("Opened...!"); } To see if it would print on opening either my inventory or the horse's inventory. Sadly, nothing printed. Im very confused...
-
Is there a way to edit a horse's inventory to allow my custom saddle to be placed in its inventory?
Thanks! I will check that out.
-
Is there a way to edit a horse's inventory to allow my custom saddle to be placed in its inventory?
Where is all of this server and client thing? Im guessing you dont mean something like writing this code somewhere, right?
-
shrexish joined the community
-
Is there a way to edit a horse's inventory to allow my custom saddle to be placed in its inventory?
This is my first ever mod. Im trying to do something fairly simple. I created a custom saddle for horses. The idea is that when you place the saddle in the horse's inventory, you can ride the horse with your friend. The saddle is called "Saddle For Two". I need to make the horse accept my saddle as normal saddle that would be able to be placed in its inventory. Later on I will begin to work on the functionality where two players can ride one horse. For now i just need to be able to place my custom saddle in the horse's inventory. Is it even possible to mess around with that?
IPS spam blocked by CleanTalk.