Jump to content

Frost2779

Members
  • Posts

    25
  • Joined

  • Last visited

Everything posted by Frost2779

  1. So currently I am trying to implement a little system where when an item has less than 10 seconds left before it despawn it's starts to blink, as in turn invisible then visible again. However, I can't seem to find the right event to tap into for this. I probably just over looked it when I was looking through all the event but the problem still stands.
  2. Do you know of any way I would be able to do what it is I want without having to recreate portions of the source code?
  3. Alright so in my mod there are going to be several types of elytra with tweaked stats, like durability, ability to be repaired ect. However I can't seem to get my elytra to function at all. My elytra already extends ItemElytra, but is there still more I need to do? Elytra class: Items Class:
  4. Thanks, do you have any insight as to why my event handler isn't working? Edit: One problem is that if i kill it through onEntityItemUpdate it doesn't appear in your hand
  5. So there is an item in my mod that I want to be destroyed whenever it is dropped onto the ground. But I can't seem to find a way to accomplish this, any ideas? Secondly I am having a problem with initializing my event handler, as it doesn't give my item to players when they respawn. Event Handler: package com.Frost2779.AWillToLive.Init; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.PlayerEvent; @Mod.EventBusSubscriber public class EventHandler { @SubscribeEvent public void PlayerRespawnEvent(PlayerEvent.PlayerRespawnEvent event) { if (!event.player.world.isRemote) { event.player.inventory.addItemStackToInventory(new ItemStack(ModItems.fullWill)); } } }
  6. My mistake package com.Frost2779.AWillToLive.Items; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class ItemFullWill extends Item { public ItemFullWill(){ this.setMaxDamage(100); this.setMaxStackSize(1); } @Override public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) { return false; } @Override public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) { if(entityIn instanceof EntityLivingBase) { if (stack.hasTagCompound() && stack.getTagCompound().hasKey("TickCounter")) { int tickCounter = stack.getTagCompound().getInteger("TickCounter"); if (tickCounter <= 0) { stack.damageItem(1, ((EntityLivingBase) entityIn)); stack.getTagCompound().setInteger("TickCounter", 100); } else { stack.getTagCompound().setInteger("TickCounter", --tickCounter); } } else { stack.getTagCompound().setInteger("TickCounter", 100); } } } }
  7. Whenever I load a world with the code above in my item class I crash with this error.
  8. How do you go about adding the NBT tag to an item? and should i put it in the onCreated meathod?
  9. So I have an item that I want to make lost a durability every 5 seconds, so every 100 ticks. I've done some looking around about implementing a tick counter into NBT to help track this, but so far I have been unsuccessful in getting this to work(as entire functions that are present in the tutorial are not there any more).
  10. Is there a way I can make my crafting recipes more efficient than this? Like what the title says can I make it include certain ranges of Meta values? GameRegistry.addShapelessRecipe(new ItemStack(ModItems.natureDust), ModItems.mysticPestle, new ItemStack(Blocks.SAPLING, 1, 1)); GameRegistry.addShapelessRecipe(new ItemStack(ModItems.natureDust), ModItems.mysticPestle, new ItemStack(Blocks.SAPLING, 1, 2)); GameRegistry.addShapelessRecipe(new ItemStack(ModItems.natureDust), ModItems.mysticPestle, new ItemStack(Blocks.SAPLING, 1, 3)); GameRegistry.addShapelessRecipe(new ItemStack(ModItems.natureDust), ModItems.mysticPestle, new ItemStack(Blocks.SAPLING, 1, 4)); GameRegistry.addShapelessRecipe(new ItemStack(ModItems.natureDust), ModItems.mysticPestle, new ItemStack(Blocks.SAPLING, 1, 5));
  11. Okay thank you. I'll work my way through a few of the tutorials and come back if I come across any major problems I can't solve
  12. Need some help figuring out how to create a custom dimension. I've done some looking around in the source code but can't seem to figure it out, and google results only come up with very outdated tutorials.
  13. After much looking I have been unable to find a way to create an item the behaves in the same way as the elytra, only with sever small things changed about it. Anyone have any ideas on how this could be accomplished?
  14. So far i'v figured out you can add a description to an Item by using the addInformation found within the Potion class. However i haven't been able to find a way to add a description to a block.
  15. Can anyone point me in the direction to a up to date tutorial on GUIs that open when you right click and item? I haven't had much luck finding any
  16. I was able to get it working, I just hadn't waited long enough for github to update the raw file. Thanks for the help though!!
  17. Okay, so I tried doing it and i can't get it to work. I added the updateJSON parameter to my @mod annotation, which contains the link to my JSON which i hosted on github. Though for some reason it's not working, it's probably something on my part but i'm not sure what. The current version of my mod is 0.4.1 and here is the link to my JSON. https://github.com/Frost2779/Mod-Update-Version/blob/master/Update
  18. I'm currently working on a system to alert the player with a chat message when they are playing with a version of the mod that is out of date. I can't however find a way to send a chat message to the player. Any ideas?
  19. I'v digging around in the source code to try and find out how it is to create a mob spawn egg for a mob and so far I have been unsuccessful, and when i try and google it I only find out of date videos. How do i go about creating a mob spawn egg?
  20. So far i have been declaring my items like so public static Item reinforcedStick; public static Item reinforcedLeatherSquare; public static Item reinforcedLeatherWing; public static Item leatherHarness; public static Item woodenElytra; And i was wondering if it was possible to compress all of that down into an array like this or something similar. item[] itemArray = {reinforcedStick, reinforcedLeatherSquare, ect.}; I messed around with it to try and get it to work but was unsuccessful.
  21. So in the mod i am making there is an Item that has the same functionality of the Elytra only it has some stats changed and a couple other things. How would i go about creating this item so it behaves in the same way as the Elytra does?
×
×
  • Create New...

Important Information

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