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

Hi,

 

I am making a new item for a vanilla block (Ice block).

I have created Ice Shards, and you could get it when breaking Ice Blocks.

I don't think it's hard, but sometimes you just don't know how to get this to work. :P

 

Thanks for helping.

Creator of the Master Chef Mod and many more to come.

 

If I helped you, please click the 'thank you' button.

  • Author

Thanks,

 

I am trying to work at the HarvestDropsEvent in my "IceDrops" class file.

 

But I don't really now how to get the ice dropping my ice shards.

Cause I don't know how to set the quantity and the harvestlevel and things like that.

I hope I am working in the right direction. This is my code:

 

package com.chef.mod.event;

import java.util.Random;

import net.minecraft.entity.passive.EntitySquid;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent;

import com.chef.mod.Chef;

import cpw.mods.fml.common.eventhandler.SubscribeEvent;

public class IceDrops {

          public static double rand;
          public Random r = new Random();

          @SubscribeEvent
          public void onBlockDestroyed(HarvestDropsEvent event) {
          if(event.block == Blocks.ice) {
          event.drops.add(new ItemStack (Chef.fuelIceShard));
          }
          }
                 
}[/Code]

Creator of the Master Chef Mod and many more to come.

 

If I helped you, please click the 'thank you' button.

  • Author

Nvm, I got it.

 

Thanks!

Creator of the Master Chef Mod and many more to come.

 

If I helped you, please click the 'thank you' button.

Guest
This topic is now closed to further replies.

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.