Jump to content

zacharyjaiden

Members
  • Posts

    59
  • Joined

  • Last visited

Everything posted by zacharyjaiden

  1. *facepalm* typos FTW should probably stop "CTRL - O" importing and import stuff myself i think id save myself a lot of issues thanks
  2. hey guys, im having trouble with a forge event, the event doesnt seem to be getting called at all, ill post any relevant code if needed package com.MCR.MinecraftReloaded.Event; import net.minecraft.entity.passive.EntityCow; import net.minecraft.init.Items; import net.minecraftforge.event.entity.living.LivingDeathEvent; import com.google.common.eventbus.Subscribe; public class DropsEvent { @Subscribe public void LivingDropsEvent(LivingDeathEvent event){ System.out.println("eventdrops working"); if (event.entityLiving instanceof EntityCow) { event.entityLiving.dropItem(Items.bone, 3); } } } its being registered like so in forge preinit like my other events MinecraftForge.EVENT_BUS.register(new DropsEvent()); thanks in advance
  3. thanks for the help and sorry for snapping mate
  4. Ok, i get what youre saying cool alias and i guess youre right, its just im dedicating hours of my time to read java documentation, minecraft tutorials and browsing the forums, when im getting responses of "Learn basic java" its really annoying me BIG time as i am very new to this and i am like i said dedicating quite a large portion of my time to learning all the fundamentals of java and learning the way minecraft is coded, i feel like those comments shot straight out of nowhere get to me. i owe you a bit of an apology diesie, i shouldnt of gotten angry at you, i do in fact appreciate your help, ive known the basics of java and modding minecraft for quite a while although havent done it for a couple years so i have forgotten quite a few things... i never needed to expand my knowledge of java cause i didnt need to know anything new but ive been trying to venture into new territories in modding and faced a lot of java problems and in doing so, ive spent hours recapping over the java i already knew, and have spent hours reading up on new java information when relevant issue arise, i may ask some dumb questions but like i said im new, i absolutely do not want anybody to write the mod for me but i do appreciate helpful information something like "google switch statements mate that might help" rather than "Learn basic java. use (this word) instead of (thatword)" helps a lot more and would be appreciated 100 times more if im asking a question on here its because i probably dont know what area of java to look up for the class im trying to create
  5. you do need to get off your high horse, just because somebody doesnt understand java yet to the extent that you do does not mean that they dont know "basic java", i learn the java associated with minecraft modding because im using it to MOD MINECRAFT, i learn what i can from tutorials (which im sure you read tutorials when you were starting out too) also from minecraft source code, i dont know all of the applications of the code ive learnt but i know how to use it pretty widely, what i dont know i come to this forum for help, (which is the very purpose of this forum) not for criticism on my knowledge of the language... your contribution consisted of a single word, which i already knew just didnt think to apply it and you find it necessary to downgrade my knowledge and skills when in comparison to you obviously high opinions and views on your own, i am fairly new to java and minecraft modding hence why i seek out support. again get off your high horse mate come to this forum to help people not throw out negative comments. that one word "instanceof" was all i needed not my code written for me as you seem to think
  6. thank you for your amusing arrogance diesieben but i do know basic java. you dont have to try and belittle everyone on this forum i look at quite a few posts on this forum and a great percentage of them have at least one post from you using that little phrase of yours, i have used instanceof before with items and blocks but didnt know that it would apply to an entity since the way i came about that term implied that it was something used for "things" not entities so i never looked into it too much, obviously i was wrong but i and everyone else on this forum dont need comments like those, it may very well hinder peoples ability to learn and progress their skills as you probably make a lot of people uncomfortable and or embarrassed which im sure youre quite aware of... i dont appreciate it. my attempt in thinking if the entity == entityWHATEVER isnt that far fetched.. at least gotoLink can provide help without trying to downgrade others (appreciate your help gotolink +1 karma) and its not like i was asking anyone to code the thing for me i had a general idea of what i was doing from the start
  7. thanks, but how would i appropriately reference the entity? i tried if(event.entity == EntityBunny.class); but that errors the whole line, i tried just if(event.entity == EntityBunny); that errors on entity bunny, idk how to refer to the mob
  8. override this method /** * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer */ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if (par3EntityPlayer.fishEntity != null) { int i = par3EntityPlayer.fishEntity.func_146034_e(); par1ItemStack.damageItem(i, par3EntityPlayer); par3EntityPlayer.swingItem(); } else { par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); if (!par2World.isRemote) { par2World.spawnEntityInWorld(new EntityFishHook(par2World, par3EntityPlayer)); } par3EntityPlayer.swingItem(); } return par1ItemStack; } to do that add "@Override" to the line above public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) in your new overridden method change the line par2World.spawnEntityInWorld(new EntityFishHook(par2World, par3EntityPlayer)); >>>>>>ENTITYFISHHOOK<<<<< to your new custom entity fish hook and fix the appropriate errors if any occur
  9. lol ive never seen that before >.< thats cool i kinda want to know how you did it so i can do it you didnt change the resolution of the texture did you ?
  10. bounding boxes can move with blocks but you have to add another method to change the bound box with orientation, the bound box is done in floats i believe it starts to one side of a block, not from the middle, but you can figure out what values change what side by trial and error this is code for a cube like bounding box in the middle of a block this.setBlockBounds(A-0.170F, B-0.0F, C-0.180F, D-0.830F, E-0.80F, F-0.820F); B value when increased moves the bottom of the bounding box upwards the E value when DECREASED moves the top of the bounding box down or when Increased moves the bounding box border upwards i believe A and D are x axis, also C and F are y axis (OR THE OTHER WAY AROUND) off memory the bound box DOESNT move with entities but i may be wrong there may be a way for it
  11. ok so im making it so that my custom entities (and maybe some vanilla entities) can only spawn when condition is met, i have browsed through the forge events and found the event living spawn event, is that suited for this? i am not quite sure how to properly use this event can anybody help out with this? in sudo ive kinda thought of this way @SubscribeEvent public void LivingSpawnEvent(LivingSpawnEvent event) { EntityPlayer player = (EntityPlayer)event.getPlayer(); if(event.entity == EntityCutstomMob && StorageLevel.getPlayer().GetMasterLevel() < 5) { setCanceled{True} } } i know this event or a part of this event is cancelable but im not 100% sure how to properly set canceled so if anyone knows that aswell please let me know, but basically i need to know how to do this in the way that ive displayed but obviously not sudo properly with the correct terms and such thanks in advance +1 karma for any answers (that arent just for sake of getting karma)
  12. ive added the enchantment effect to items using, @SideOnly(Side.CLIENT) public boolean hasEffect(ItemStack par1ItemStack) { return true; } with a few items like ingots and such just inside the item class, armour is made like an item and has the ability to use the effect in standard vanilla, i dont see why you cant use the method in the armour class? have you tried it
  13. okay thats kinda what i was looking for a place to start, (what to extend) i think flowers is a good option as i dont need anything special to happen i just need these bushes to randomly spawn like flowers... but do you mean to say that event can be used in conjunction with the the generator or can be used in replace of the generator for what i need to do
  14. what was it that fixed your issue?
  15. thanks for the link but that was a link to creating the flower block itself with i already had, i need to generate it, from what ive gathered i need to use the biome decorator, my questions are: what class should i extend to use biome decorator? should i extend biome decorator itself or IworldGenerator (like i did with my ores) or World generator like with a tree or what, BiomeGenBase im not sure where to start off my file... (Im a noob when it comes to all generation apart from ore)
  16. ive created crops for my mod and think its too easy to just get seeds from grass, i want to generate a plant randomly similar to dead shrubs and ferns in specific biomes (the plant would be a plant version of my crop that drops A seed or something) i googled and didnt find any tutorials on anything other than ore generation which i already know, is anyone able to point me in the right direction and or help me out with this ??
  17. is register render things registered in your server proxy public void registerRenderers() { // Nothing here as the server doesn't render graphics or entities! }
  18. hey not sure how relevant it is but all your slots in the container use "slot" why is the output slot not using an output slot? addSlotToContainer(new Slot(te, 0, 56, 17)); addSlotToContainer(new Slot(te, 1, 56, 53)); addSlotToContainer(new Slot(te, 2, 116, 35)); addSlotToContainer(new Slot(te, 3, 154, 6)); the vanilla furnace itself has its own furnace output slot this.addSlotToContainer(new Slot(par2TileEntityFurnace, 0, 56, 17)); this.addSlotToContainer(new Slot(par2TileEntityFurnace, 1, 56, 53)); this.addSlotToContainer(new SlotFurnace(par1InventoryPlayer.player, par2TileEntityFurnace, 2, 116, 35)); from what i gathered your making a powered furnace of some sort but still using vanilla recipes and resembling the vanilla furnace, ive always used an output slot as well as "Slot" as both the slot classes are different and obviously do different things ive never not used one to see the relevancy. but it might be something to chuck in there anyway, ive just browsed through quite a few source codes and tutorials and i cannot find a single person that has "slot" for every slot either, every single one of them has an output slot. and considering you issue is the output and maybe the output SLOT itself... maybe its something to do with that? so if nobody else is replying and your looking for things to test out maybe give it a crack? haha its a little problem maybe youll get lucky with a little solve :)
  19. OMG thats it! thankyou, i cant believe i overlooked something so simple!!! serves me right for being lazy and copying "StorageMiningLevel.get(player).GetLevel());" from another class in my mod to save time +1000 karma for you mate :) :) :)
  20. thanks for the advice but it i tried the code and it didnt stop the mass spamming of additions to the inventory nor the inability to hold the pickaxe EVEN if the condition (level) is met i dont see why its doing this, the if statement states that IF the players holding both a pickaxe AND has a level lower than 5, run the contents of {} but i dont even have a pickaxe in my inventory and its spamming ingots and sticks into it
  21. Pretty sure this will work accompanied with the appropriate model files and stuff http://www.youtube.com/watch?v=pY2kgGa70Z4 <- this link is slightly outdated but if you follow it you should be able to figure out the concepts quite easily im pretty sure aside from the file below it requires similar files to rendering a block model EDIT: http://greyminecraftcoder.blogspot.com.au/2013/09/custom-item-rendering-using.html helps out perfectly
  22. Trying to limit the ability to hold a specific item when the condition isnt met. it works fine although the player cant hold the item when the condition IS met either any ideas, also its set that upon deletion of the item, the relative materials are added back the the players inventory BUT theyre also glitching out and rather then adding only one instance of the materials theyre flooding the inventory by the bucketfull code as follows package com.MCR.MinecraftReloaded.Event; import com.MCR.MinecraftReloaded.Items.ModItems; import com.MCR.MinecraftReloaded.LevelingLib.StorageMiningExperience; import com.MCR.MinecraftReloaded.LevelingLib.StorageMiningLevel; import com.MCR.MinecraftReloaded.LevelingLib.StorageWoodCuttingExperience; import com.MCR.MinecraftReloaded.LevelingLib.StorageWoodCuttingLevel; import com.MCR.MinecraftReloaded.LevelingLib.SyncPlayerPropsPacketMiningLevel; import com.MCR.MinecraftReloaded.Main.MinecraftReloaded; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; public class PlayerLivingUpdateEvent { @SubscribeEvent public void onPlayerUpdate(LivingUpdateEvent event) { if(event.entityLiving instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) event.entityLiving; if(player.inventory.hasItem(ModItems.CastrealmPickaxe) && StorageMiningLevel.get(player).GetLevel() < 5);{ player.inventory.consumeInventoryItem(ModItems.CastrealmPickaxe); player.inventory.addItemStackToInventory(new ItemStack(Items.stick, 2)); player.inventory.addItemStackToInventory(new ItemStack(ModItems.CastrealmIngot, 3)); } } } }
  23. fairly certain you can also do it in the block itself in public ModOreName() { super(Material.rock); this.setHardness(46); this.setHarvestLevel(toolClass, level); } section as well
  24. hmm reading that, im not sure it will really work (im new so i may not be understanding it properly) but it seems those check and things are for crafting results in general you cant define item specifics in there, i need quite a lot of items to be crafted on the condition that the level requirement is met...... is there by any chance an on crafting event? through use of packet handlers and setting and changing nbt data that holds a value (level) ive crated a leveling system, its set up that i can retrieve that value through StorageLevel.get(player).GetLevel() ive used it for a lot of events before what i want to do it have set values that items are able to be crafted,eg if level 1 then allow item1 to be crafted if level two allow item2 to be crafted and so on the thing you linked me to as far as i could interpret it was adding extra conditions to items being crafted but it seems like it couldnt be used to achieve what im trying to achieve so would it be possible to use some oncrafted event if it exists?
  25. have you registered it in your proxy? ClientRegistry.bindTileEntitySpecialRenderer(TileEntityYOURTILEENTITY.class, new TileEntityYOURTILEENTITYRender());
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.