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.

statphantom

Members
  • Joined

  • Last visited

Everything posted by statphantom

  1. still having the problem of my tools in my custom event handlers not being destroyed, but also I would like to know how to output text into the ingame chat, I thought it would be something simple but can't find anything on how to do it.
  2. not working, I tried doing event.entityPlayer.getHeldItem() = null; probably wrong but was the only way I thought of
  3. will this play the destroyed sounds etc. also?
  4. Sorry had no progress yesterday, I have had some stuff happening so didn't have the time. But back to business! I still am having trouble manually doing a check to destroy my item as I damage it from an event handler as there is no onItemUse call but I can't figure out how to manually destroy the item, it just degrades to 0 then the bar starts to fade red once it gets into negative numbers. Also how do I create and store player unique values? I am wanting to create a few 'skills' and 'levels' etc for things like mining, strength, agility etc. Thanks for all your guys support, this forum has been an amazing help for me.
  5. I don't think is is possible due to the fact that I can not think of a mod that does this, all recipes that need more then 1 of a type of item always puts 1 item in a different slot. e.g. thermal fundations mods of making bronze needs 1 tin 3 copper however you need 3 of 1 copper to do this. I hope I am wrong but as far I know there isn't a way.
  6. It seems to be checking the example mod twice, I am guessing because you are using a lot of the same code, as Failender suggested deleting the original example mod should fix this.
  7. I have my rake working, however since it doesn't destroy any blocks it never calls item use when using it as a rake, I can manually damage the item stack easily using helditem.attemptDamageItem(1, Level.rnumber); but I cant find out how to manually destroy the item when this method breaks the item. Anyone help? Thanks
  8. Thanks! still learning here, what value do you recommend I offset it to if you can specify
  9. @SubscribeEvent public void onPlayerClickEvent(PlayerInteractEvent event) { if (event.action == Action.LEFT_CLICK_BLOCK) { Block block = event.world.getBlockState(event.pos).getBlock(); if (event.entityPlayer.getCurrentEquippedItem() == null) { if (block == Blocks.grass && event.face == event.face.UP) { if (!event.world.isRemote) { if (checkIfUnderLeaves(event)) { float chance = Level.rnumber.nextFloat(); if (chance < 0.10f) { event.world.setBlockState(event.pos, Blocks.dirt.getDefaultState()); } if (chance < 0.15f) { event.world.spawnEntityInWorld(new EntityItem(event.world, event.pos.getX(), event.pos.getY(), event.pos.getZ(), new ItemStack(Items.stick))); } else if (chance > 0.985) { event.world.spawnEntityInWorld(new EntityItem(event.world, event.pos.getX(), event.pos.getY(), event.pos.getZ(), new ItemStack(Level.sharpstick))); } } } } I think its due to im spawning the item at the block location when the block is not destroyed, but unsure what to do about it since i do the same thing about logs where you can be any side so spawning on top wont work
  10. is this what you mean? package statslevelmod; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraftforge.fml.common.registry.GameRegistry; public class SharpStick extends Item { private final String name = "sharpStick"; public SharpStick() { super(); GameRegistry.registerItem(this, name); setCreativeTab(CreativeTabs.tabMisc); setUnlocalizedName(name); setMaxStackSize(64); } }
  11. the super constructor needs a float, an enum, and a set. for the float, damage i just put 2.0f, but for the enum I put EnumHelper.addToolMaterial("woodenrake", 0, 31, 0f, 2f, 2); and for the set, I put null (does that just mean none set)?
  12. yes but I really want to do more with it, and create other tools such as hammers, wrenches, etc
  13. I am trying to make a custom tool, but am unsure how to do this, by custom I mean custom custom, only effective on certain blocks with durability etc, without extending pickaxe / shovel etc. how do I go about doing this, do I still need ToolMaterial? should I extend one of the tool classes but override everything? any help is appreciated. thanks. PS: I am trying to make a 'rake' tool that when you click on a grass block with it it will gather a few sticks, rocks, etc. and then loose durability, but also has damage against entities etc.
  14. Sorry, not fixed, Items still fly out at a weird direction, can anyone help me with spawning the items maybe a little push towards the player?
  15. fixed the items spawning and flying away by using spawnEntityInWorld(). Now I think I will work on making a wooden hatchet and using that hatchet to get more bark
  16. using Block.spawnAsEntity(event.world, event.pos, new ItemStack(Items.stick)); does spawn items fine, but if used on a non destroyed block the object kinda 'flys' out of it, how can I stop this from happening?
  17. gathering of sticks only under leaves is working perfectly, scans upward of 20 blocks, but cancels as soon as it hits a non-leaf block (excluding air ofc)
  18. Fixed my texture problem! it was both a wrong path but the crash was due to me calling it during preInit, not Init. new idea: I want sharp sticks to only be gathered when under leaves, I am thinking of doing a loop check, checking the block two above the block clicked, then +1 Z axis untill either it hits a leaf block then it passes true, up to..... I am tihnking 20 blocks high at which point it will return false. Is this a good way to do this or is there a better way?
  19. FIXED IT! Basically I copied and pasted my asset folder and subfolders everywhere, found it worked, so deleted one at a time to find the right one
  20. Thanks! that fixed the crash but the item has no texture, so probably I have a pathing problem also.
  21. hey guys really stuck here, Can't figure out why my texture rendering isn't working. I THINK it is a path issue. I am using the forge eclipse environment. main class: My Event Handler Class: My Item Class My Item JSON file: This is a screenshot of my Package Explorer: http://i.imgur.com/Vnhc4zX.png Any help is greatly appreciated, thanks
  22. I have copied my texture path all over the place but nothing seems to be working, this is a screenshot of my Package Explorer http://i.imgur.com/Vnhc4zX.png
  23. Nop no change, still getting nullpointer exception
  24. path is: src/main/resources/assets/statslevelmod/models/item/sharpStrick.json { "parent":"builtin/generated", "textures": { "layer0":"statslevelmod:items/sharpStick" }, "display": { "thirdperson": { "rotation": [ -90, 0, 0 ], "translation": [ 0, 1, -3 ], "scale": [ 0.55, 0.55, 0.55 ] }, "firstperson": { "rotation": [ 0, -135, 25 ], "translation": [ 0, 4, 2 ], "scale": [ 1.7, 1.7, 1.7 ] } } }
  25. Oooops! Make your mod ID all lower case. That's probably part, if not all of your problem with the texture thanks, fixed this but still not working, I think it might be a problem with my path but I can't find any forge eclipse environment path example to help iron out the problem my current path is. src/main/resources/assets/statslevelmod/textures/items/sharpStick.png NOT eclipse/src but have tried it in their also. PS: I really am grateful of everyone's help and I hope I'm not becoming annoying

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.