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.

nov4e

Members
  • Joined

  • Last visited

Everything posted by nov4e

  1. okok but i found that way and it works. I only need to fix this bug and i got mob drops. main.addEntry(new LootEntryItem(Items.BONE, 3, 0, new LootFunction[0], new LootCondition[] {new RandomChance(1F)}, "minecraft:bone")); I tried with loot tables but if I add a new item the mob drops the item or the porkchop(in this case the pig). I want to drop porkchops and bones.
  2. Because I followed a tutorial on a website. I think also is easier than loottables. It works well but i need to know why when I kill a mob drops 2 bones and it also drops 2 bones not collectible.
  3. Ok, I changed method. Now I'm using LivingDeathEvent : int quantity = 2; @SubscribeEvent public void onMobKilled(LivingDeathEvent e) { //e.getEntityLiving().dropItem(Items.BONE, quantity); e.getEntity().dropItem(Items.BONE, quantity); } But when I kill a mob it works but also drops not collectible items. ScreenShot Link: https://ibb.co/dqiVDV
  4. @V0idWa1k3r that code was correct? The model file is going to be: or Thanks for you reply
  5. I changed my code. Now I'm trying to use metadata but the model registry try to find the model with a random name example: com.nov4e.nex.obj.items.tools.claybucket@3c55c035 public void registerItemRenderer(Item str_001, int str_002, String str_003) { for (int i = 0; i < ItemList.NAMES.length + 1; i++) { String model = "nex" + ":" + ItemList.clayBucket; if (i != 0) { model += "_" + ItemList.NAMES[i - 1]; } ModelResourceLocation loc = new ModelResourceLocation(model); ModelLoader.setCustomModelResourceLocation(ItemList.clayBucket, i, loc); } } ItemList.NAMES = public static final String[] NAMES = {"water", "lava"};
  6. so what is the problem? Buckets need a special model?
  7. try this: @SubscribeEvent public void mobDrop(LootTableLoadEvent event) { if (event.getName().equals(LootTableList.ENTITIES_WITHER)) { final LootPool main = event.getTable().getPool("main"); if (main != null) { main.addEntry(entry); } } }
  8. Yeah I'm going to change all my strings
  9. I can't post it. But buckets need a special model? horribly??
  10. Hi, I maked a custom bucket. The texture is the everytime the same. ItemBucket: HUniversalBucket: Model: What is the problem? THREAD SOLVED. Solution: buckets not need a model but they need a blockstate: { "forge_marker": 1, "defaults": { "model": "forge:item-layer", "textures": { "layer0": "nex:items/clay_bucket_base", "layer2": "nex:items/clay_bucket_cover" }, "transform": "forge:default-item" }, "variants": { "inventory": { "model": "forge:forgebucket", "textures": { "base": "nex:items/clay_bucket_base", "fluid": "forge:items/bucket_fluid", "cover": "nex:items/clay_bucket_cover" }, "custom": { "fluid": "water", "flipGas": true } }, "milk": [{ "textures": { "layer1": "forge:items/bucket_fluid" } }] } }
  11. lmao if (ItemDye.applyBonemeal(str_006, str_002, str_003, str_001, str_004)) { if (!str_002.isRemote) { str_002.playEvent(2005, str_003, 0); } str_006.shrink(1); } str_006.shrink(1); this maybe work?
  12. I SOLVED: @Override public EnumActionResult onItemUse(EntityPlayer str_001, World str_002, BlockPos str_003, EnumHand str_004, EnumFacing str_005, float f_001, float f_002, float f_003) { ItemStack stack = new ItemStack(this); if (!str_001.canPlayerEdit(str_003.offset(str_005), str_005, stack)) { return EnumActionResult.FAIL; } else { if (ItemDye.applyBonemeal(stack, str_002, str_003, str_001, str_004)) { if (!str_002.isRemote) { str_002.playEvent(2005, str_003, 0); } } return EnumActionResult.SUCCESS; } }
  13. I Have to override it in BasicItem? Override Item#onItemUse requires EnumActionResult but applyBonemeal needs a boolean method.
  14. Okok sorry..... I've maked a method in Basic Item: It not works. I'm asking onItemUse or onItemRightClick is correct?
  15. Eclipse says: The method onItemUse(ItemStack, World, EntityPlayer, BlockPos, EnumHand) of type IAnimalExcrements must override or implement a supertype method. It makes some difference? no.
  16. ok, I have to register it??
  17. Hi, I'm trying to add an item that works like bone meal. For now I tried to add this function but it not work: @Override public boolean canItemEditBlocks() { return true; } public boolean onItemUse(ItemStack str_006, World str_002, EntityPlayer str_003, BlockPos str_005, EnumHand str_007) { return ItemDye.applyBonemeal(str_006, str_002, str_005, str_003, str_007); } EDIT: Thred solved, correct code: @Override public EnumActionResult onItemUse(EntityPlayer str_001, World str_002, BlockPos str_003, EnumHand str_004, EnumFacing str_005, float f_001, float f_002, float f_003) { ItemStack stack = new ItemStack(this); if (!str_001.canPlayerEdit(str_003.offset(str_005), str_005, stack)) { return EnumActionResult.FAIL; } else { if (ItemDye.applyBonemeal(stack, str_002, str_003, str_001, str_004)) { if (!str_002.isRemote) { str_002.playEvent(2005, str_003, 0); } } return EnumActionResult.SUCCESS; } }
  18. I rename all my strings like that.
  19. I'm trying to add chickens that drops feathers after tot ticks. package com.nov4e.nex.tweaks; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.passive.EntityChicken; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class TChickenDropsFeather { boolean str_001; boolean str_002; int str_003; @SubscribeEvent public void onLivingUpdate(LivingUpdateEvent e_001) { if(e_001.getEntity().getEntityWorld().isRemote || !(e_001.getEntity() instanceof EntityChicken)) return; EntityChicken str_004 = (EntityChicken) e_001.getEntity(); if((str_001 || !str_004.isChild()) && str_004.getEntityWorld().rand.nextInt(str_003) == 0) str_004.dropItem(Items.FEATHER, 1); } @SubscribeEvent public void onLivingDrops(LivingDropsEvent e_002) { if(!str_002 || e_002.getEntity().getEntityWorld().isRemote || !(e_002.getEntity() instanceof EntityChicken) || !((EntityChicken)e_002.getEntity()).isChild() && !str_001) return; EntityChicken str_005 = (EntityChicken) e_002.getEntity(); boolean str_006 = false; for(EntityItem str_007 : e_002.getDrops()) if(!str_007.getItem().isEmpty() && str_007.getItem().getItem().equals(Items.FEATHER)) { str_006 = true; break; } if(!str_006) e_002.getDrops().add(new EntityItem(e_002.getEntity().getEntityWorld(), str_005.posX, str_005.posY, str_005.posZ, new ItemStack(Items.FEATHER, 1))); } } When I spawn a chicken the game crashes:

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.