-
Posts
169 -
Joined
-
Last visited
Everything posted by nov4e
-
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.
-
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.
-
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
-
ok
-
I fixed
-
@V0idWa1k3r that code was correct? The model file is going to be: or Thanks for you reply
-
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"};
-
so what is the problem? Buckets need a special model?
-
[1.12] Mod drop loot, am I doing this right?
nov4e replied to TheGoldenProof's topic in Modder Support
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); } } } -
Yeah I'm going to change all my strings
-
I can't post it. But buckets need a special model? horribly??
-
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" } }] } }
-
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?
-
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; } }
-
Correct?
-
I Have to override it in BasicItem? Override Item#onItemUse requires EnumActionResult but applyBonemeal needs a boolean method.
-
Okok sorry..... I've maked a method in Basic Item: It not works. I'm asking onItemUse or onItemRightClick is correct?
-
please stop
-
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.
-
ok, I have to register it??
-
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; } }
-
[Solved] Game Crashes When I Spawn A Chicken With My MOd
nov4e replied to nov4e's topic in Modder Support
I fixed. -
[Solved] Game Crashes When I Spawn A Chicken With My MOd
nov4e replied to nov4e's topic in Modder Support
I rename all my strings like that. -
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:
-
No Fire Spread mod (working, but is it done right?)
nov4e replied to Laike_Endaril's topic in Modder Support
oh ok