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.

redtub345

Members
  • Joined

  • Last visited

Everything posted by redtub345

  1. Is this the wrong topic? I'm new here sorry.
  2. So I want my mobs to always spawn with armour using an event, so I used: package com.example.examplemod.events; import com.example.examplemod.DirtMod; import com.example.examplemod.util.RegistryHandling; import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.item.ItemStack; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.event.entity.*; @Mod.EventBusSubscriber(modid = DirtMod.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT) public class ModClientEvents { @SubscribeEvent public static void onMobSpawn(EntityJoinWorldEvent event) { DirtMod.LOGGER.info(event.getEntity().getName().getString().toLowerCase()); if (event.getEntity().getName().getString().toLowerCase() == "zombie") { DirtMod.LOGGER.info("Zombie equipped (almost)"); event.getEntity().setItemStackToSlot(EquipmentSlotType.MAINHAND, new ItemStack(() -> RegistryHandling.CDIRT_AXE.get(), 1)); event.getEntity().setItemStackToSlot(EquipmentSlotType.HEAD, new ItemStack(() -> RegistryHandling.CDIRT_HELMET.get(), 1)); DirtMod.LOGGER.info("Zombie equipped!"); } } } It isn't working, and the log doesn't show "Zombie Equipped (almost)". Please help P.S. CDIRT_HELMET and CDIRT_AXE are both custom armour, one of an armour type and one of a axe type.

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.