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.

minecraftisscience

Members
  • Joined

  • Last visited

Everything posted by minecraftisscience

  1. Thank you very mutch. The lines you quoted were my very first attempts to spawn something. I will remove them and, in the long run, make the spawned entity depend on the held item datavalue. For now i just tried to figure out, how to get baby animals. I try to set the growingAge. Thanks for that.
  2. Hey there, i am programming a villager mod for Minecraft 1.12.2 and i want my villagers to trade special Items. Now I'm struggling with the code of one of these items. I want an Item, that can spawn only baby vanilla animals, like baby pigs, baby cows and so on. But i don't really know, how to spawn baby animals. At the moment, the following code in the items 'onItemRightClick' function spawns only adult vanilla pigs. @Override public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand hand) { ItemStack itemstack = playerIn.getHeldItem(hand); if(!worldIn.isRemote){ EntityPig pig = new EntityPig(worldIn); EntityAgeable child = new EntityPig(worldIn).createChild(pig); child.setPosition(playerIn.posX + 0.5D , playerIn.posY, playerIn.posZ + 0.5D); worldIn.spawnEntity(child); itemstack.shrink(1); return new ActionResult(EnumActionResult.SUCCESS,itemstack); } return super.onItemRightClick(worldIn, playerIn, hand); } What can i do, to get only baby pigs? And is this even possible? Thank you very mutch

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.