Jump to content

warpspeed10

Members
  • Posts

    6
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

warpspeed10's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. Hey guys, Do you know if there is any means by which I can count the number of mobs in a given area (let's say 10x10x10) of my block?
  2. Hi, I'm trying to add some cool additional functionality to a vanilla enchantment when applied to an item it normally could not be put on. My goal is to allow the user to place Silk Touch on any sword using an enchanted book and an anvil, similar to shears. I then want to modify the loot of any mob killed by a sword with this enchantment. I have poked around a little bit and found the canApply(ItemStack par1ItemStack) function in EnchantmentUntouching. Adding this to the end of the ternary operator allows silk touch to be placed on a diamond sword in addition to a shear. public boolean canApply(ItemStack par1ItemStack) { return par1ItemStack.getItem().itemID == Item.shears.itemID ? true : par1ItemStack.getItem().itemID == Item.swordDiamond.itemID ? true : super.canApply(par1ItemStack); } I have also found getSilkTouchModifier(EntityLiving par0EntityLiving) in EnchantmentHelper that is used to determine whether or not the item in the player's hand has silk touch. I'd rather not modify a base class though. Is there a way to override silk touch to add in some additional functionality? P.S. Is there some way to nicely format code on this forum? I did not see any option to when making this post.
  3. Hey guys, after taking a break from modding for a couple weeks, I may have found the solution. I was browsing the World code today when I ran across this nifty function. I have not yet finished up the other stuff I need before I test this, but just looking it over, it seems to be what I was looking for.
  4. Hi guys, I'm fairly new to working with forge, and I ran into a bit of a rut while working on my mod. I'm trying to find some method or member I can call to check the strength of the redstone signal that my block is receiving. I've had a look at BlockRedstoneWire and BlockRedstoneLight for some hints, however the only public methods I could find tell me only if there is or is not power, not the strength of that signal between 0 and 15. My closest guess is that I may be able to use getMaxCurrentStrength(), though the comments on that were a bit ambiguous. My goal for this block is to detect the strength of a redstone signal and then adjust its texture accordingly.
×
×
  • Create New...

Important Information

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