Jump to content

Bloopers

Forge Modder
  • Posts

    77
  • Joined

  • Last visited

Everything posted by Bloopers

  1. Don't know if this is related or not, but is it possible to make it so that you can walk through the block only while doing something(like crouching) - The block I'm trying to make is somewhat like a rope/rope ladder
  2. Been looking around, can't seem to find the area in the vine or ladder class that makes it climb-able. Any clues?
  3. Yes, I can only figure out how to make a random true or false thing(pretty much just a coin flip, I guess.) I'm having trouble with randomizing more than boolean.
  4. I'd like to create a "goodie bag" that, on right click, will give a couple random items(0-2 diamonds, 1-3 gold ingots, 2-3 iron ingots, to be exact) - And if the player's inventory is full, drop the items on the ground. Can't seem to find any way to do this.
  5. I've managed to make the item work only if an ender pearl is in the inventory now. I can't figure out how to consume an ender pearl from the inventory and I also cannot figure out how to do the velocity(it seems like ender pearls have a lot less parameters than arrows)
  6. Hello, I've created this item that will charge up like a bow and shoot an ender pearl(thanks to the help of Choonster) I'd like to expand on it a bit more, however. This is my class file for the item right now: package bloopers.trinkets.items; import javax.annotation.Nullable; import net.minecraft.command.ICommandSender; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityEnderPearl; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.entity.projectile.EntityTippedArrow; import net.minecraft.init.Enchantments; import net.minecraft.init.Items; import net.minecraft.init.SoundEvents; import net.minecraft.item.EnumAction; import net.minecraft.item.Item; import net.minecraft.item.ItemArrow; import net.minecraft.item.ItemEnderPearl; import net.minecraft.item.ItemStack; import net.minecraft.stats.StatList; import net.minecraft.util.ActionResult; import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumHand; import net.minecraft.util.SoundCategory; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class ItemEnderRifle extends Item { public ItemEnderRifle() { this.maxStackSize = 1; this.setMaxDamage(32); this.setCreativeTab(CreativeTabs.MISC); } @Override public EnumAction getItemUseAction(ItemStack stack) { return EnumAction.BOW; } /** * How long it takes to use or consume an item */ @Override public int getMaxItemUseDuration(ItemStack stack) { return 5000; } @Override public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand) { playerIn.setActiveHand(hand); return new ActionResult(EnumActionResult.SUCCESS, itemStackIn); } @Override public void onPlayerStoppedUsing(ItemStack stack, World worldIn, EntityLivingBase entityLiving, int timeLeft) { if (!worldIn.isRemote) { EntityEnderPearl entityenderpearl = new EntityEnderPearl(worldIn, entityLiving); entityenderpearl.setHeadingFromThrower(entityLiving, entityLiving.rotationPitch, entityLiving.rotationYaw, 0.0F, 1.5F, 1.0F); worldIn.spawnEntityInWorld(entityenderpearl); stack.damageItem(1, entityLiving); } } } So, I want to be able to make it require ammo(an ender pearl) AND I want it to have different velocities depending on how much you charge up the item(it's meant to throw ender pearls extra far) Any help is appreciated.
  7. It's all fixed now. Thank you so much for the help! I'm going to make another post with other questions related to this item soon.
  8. Override the method by creating a method with the same name, return type and parameter types and annotating it with @Override . Your IDE should be able to do this for you. It's not strictly necessary, but you should also annotate your override method with the same annotations as the super method. If you've managed to override the method, post your latest code and describe what the current problem is. It's no longer giving me an error when overriding, but when I finish charging up the game crashes. I think I know the problem too. Here's the code first: @Override public void onPlayerStoppedUsing(ItemStack stack, World worldIn, EntityLivingBase entityLiving, int timeLeft) { EntityEnderPearl entityenderpearl = new EntityEnderPearl(worldIn, player); entityenderpearl.setHeadingFromThrower(player, player.rotationPitch, player.rotationYaw, 0.0F, 1.5F, 1.0F); worldIn.spawnEntityInWorld(entityenderpearl); stack.damageItem(1, player); } So, I noticed this now, is the onPlayerStoppedUsing method supposed to return something? @Override public void onPlayerStoppedUsing(ItemStack stack, World worldIn, EntityLivingBase entityLiving, int timeLeft) { EntityEnderPearl entityenderpearl = new EntityEnderPearl(worldIn, player); entityenderpearl.setHeadingFromThrower(player, player.rotationPitch, player.rotationYaw, 0.0F, 1.5F, 1.0F); worldIn.spawnEntityInWorld(entityenderpearl); stack.damageItem(1, player); } Because onItemRightClick returns EnumActionResult.SUCCESS - I wonder if onPlayerStoppedUsing is supposed to return something.
  9. That's not correct. This tutorial explains method overriding and method signatures. I'm not sure what I am supposed to do from here still, sorry to bother you again.
  10. Didn't know what method signature was before, did a search and it told me that it's the parameters before the method like public, static and void. (is that correct?) I tried multiple combinations of them and I'm still getting the error.
  11. The item will charge up now like a bow, but it doesn't do anything on release, even though I have written down to throw an enderpearl in the onPlayerStoppedUsing. This is what I have now: I couldn't put @Override ontop of onPlayerStoppedUsing(it gave me an error and told me to remove the @Override annotation)
  12. Thank you for the quick response, I have this now: But it doesn't do anything ingame(like a blank item) Any idea what I've done wrong?
  13. I'd like to create an item that is meant to charge up like a bow, and then shoot an enderpearl(meant to be able to shoot enderpearls really far). I've taken a look at the bow class file and I don't understand any of it... Any help is appreciated.
  14. Seems like you don't really want to help, so I'll go to another forum. Thanks for what you have helped me with though.
  15. Seems like you don't really want to help, so I'll go to another forum. Thanks for what you have helped me with though.
  16. That is from an old tutorial, registering it in my main class didn't work. Unless I'm just doing something wrong.
  17. I created this class, but am I supposed to register it in my main file? If so, how? package bloopers.novelties.handlers; import net.minecraft.item.ItemBed; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemSword; import net.minecraft.launchwrapper.Launch; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; public class EventItemCrafted { @SubscribeEvent public void onItemCrafted(ItemCraftedEvent event) { ItemStack stack = event.crafting; NBTTagCompound nbt = stack.getTagCompound(); if (stack.getItem() instanceof ItemBed) { stack.setTagInfo("Test", null); } } }
  18. I want to make it so that when you craft a bed, it will be given a special lore(AddInformation method I think.) but I'm not sure how. I researched crafting handlers and achievements but they are for old versions and none seem to work.
  19. I want to make an item that is craft-able and has a custom texture, but works exactly like a spawn-egg for my mob. My mob is supposed to be "summoned" using a special item. I've found plenty of outdated tutorials for this(they don't work anymore obviously) Any help is appreciated
  20. IDs for registerModEntity are local to your mod. Start at 0 and increment for every new entity. What exactly do you mean by "it doesn't exist anymore"? The mob doesn't show up in /summon (i never created a spawn egg for it in the first place) and all of them that existed in the world before are now gone.
  21. Nothing. Just registerModEntity . No, update as in change your code to use the new version. When removing the two lines saying "registerGlobalEntityID" and "findGlobalUniqueEntityIdD" how am I supposed to set the Entity ID now? When loading up the game the entity simply doesn't exist anymore - This is my EntityCreate class now:
  22. What should I use instead? Update as in update my MDK? Found my texture problem - I'm just an idiot. First two questions I still need help with
  23. I created a custom model and texture for a mob, and everything works fine, except for ingame, the mob is just purple and black checkerboard patterns. Here are the classes I used: ClientProxy.java (proxy class is registered in main class already) EntityWraithMob.java (ai class) Wraith.java(model class) RenderWraithMob.java(render class - yes, the directory for the texture is correct.) EntityCreate.java (my initialization thing for entity)
×
×
  • Create New...

Important Information

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