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.

Randomboy

Members
  • Joined

  • Last visited

  1. What I actually want is spawn some item one second after entity death but I don't know how. Here is my code: package net.some_more_boss.handler; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.client.Minecraft; import net.minecraft.util.DamageSource; import net.minecraft.util.EntityDamageSource; import net.minecraftforge.event.entity.living.LivingDeathEvent; import net.minecraft.item.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.some_more_boss.TestBoss; import net.some_more_boss.TestBoss.EntityCustom; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; public class bossEvent { @SubscribeEvent public void bossDeath(LivingDeathEvent event){ if (!(event.getEntityLiving() instanceof TestBoss.EntityCustom)) return; if (event.getEntityLiving() instanceof TestBoss.EntityCustom){ EntityCustom boss = (EntityCustom)event.getEntityLiving(); EntityPlayer player = Minecraft.getMinecraft().player; int X = Minecraft.getMinecraft().player.getPosition().getX(); int Y = Minecraft.getMinecraft().player.getPosition().getY(); int Z = Minecraft.getMinecraft().player.getPosition().getZ(); World world = (World)boss.getEntityWorld(); if (event.getSource().getTrueSource() instanceof EntityPlayer){ //wait some tick here world.spawnEntity(new EntityItem(world, X, Y, Z, new ItemStack(Items.DIAMOND_SWORD, 1))); world.spawnEntity(new EntityItem(world, X, Y, Z, new ItemStack(Items.DIAMOND_HELMET, 1))); world.spawnEntity(new EntityItem(world, X, Y, Z, new ItemStack(Items.WOODEN_AXE, 1))); } } } }

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.