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.

Featured Replies

Posted

I have made a living drops event for my food item so sheep drop lambchops but every single mob is dropping the item?!?!?

ย 

This is the code

package assassinhero.parallelworlds;

import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.passive.EntityCow;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.living.LivingDropsEvent;

public class ParallelWorldsSheepDropsEvent {

public static double rand;

@ForgeSubscribe
public void onEntityDrop(LivingDropsEvent event){
	rand = Math.random();
	if(event.entityLiving instanceof EntitySheep);

	if(rand < 1.00){
		event.entityLiving.dropItem(ParallelWorlds.RawLambChop.itemID, 3);
	}


	}

}

STOP CRUCIFYING NEW MODDERS!!!!

dunno whats wrong with yours but if i were to do what you wanted it to i would write

package ashtonsmod.common;

import net.minecraft.block.Block;
import net.minecraft.block.BlockBreakable;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.monster.EntitySheep;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;

public class BatDrops {

ย  ย  ย  ย  ย  public static double rand;

ย  ย  ย  ย  ย  @ForgeSubscribe
ย  ย  ย  ย  ย  public void onEntityDrop(LivingDropsEvent event) {
ย  ย  ย  ย  ย  ย  ย  ย  ย  if (event.source.getDamageType().equals("player")) {
ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย   rand = Math.random();
ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  if (event.entityLiving instanceof EntitySheep) {
ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย   if (rand < 1.00d){ 
ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  event.entityLiving.dropItem(ParallelWorlds.RawLambChop.itemID, 3);
ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย   }
ย  ย  ย  ย  ย  ย  ย  ย  ย  ย   }}}

Use examples, i have aspergers.

Examples make sense to me.

if(event.entityLiving instanceof EntitySheep);

You do realise that if does absolutely fucking nothing?

Then ; at the end says that you're done with the block essentally you wrote:

if(event.entityLiving instanceof EntitySheep)
{
}

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team onย Patreon

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.