Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.8] allow armor specific enchantments for items that don't extend ItemArmor
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
sigurd4

[1.8] allow armor specific enchantments for items that don't extend ItemArmor

By sigurd4, August 29, 2015 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

sigurd4    0

sigurd4

sigurd4    0

  • Creeper Killer
  • sigurd4
  • Members
  • 0
  • 137 posts
Posted August 29, 2015

i have a bauble that i want to enchant with vanilla enchantments trough an enchantment table, but i do not want my item to extend ItemArmor. however the code for checking wether or not an enchantment is valid for in item checks if the item extends the classes ItemArmor, ItemSword, Item etc. and doesn't call an event or anything like that. the same thing would apply if i were to add a sword or or something that i don't want to extend ItemSword for some reason. is there a way to do this? i've been looking for an event or hook or such but i can't find one.

  • Quote

http://www.planetminecraft.com/member/sigurd4

I'm making the bioshock mod!

Share this post


Link to post
Share on other sites

sigurd4    0

sigurd4

sigurd4    0

  • Creeper Killer
  • sigurd4
  • Members
  • 0
  • 137 posts
Posted August 29, 2015

i'm talking about EnumEnchantmentType.canEnchantItem()

  • Quote

http://www.planetminecraft.com/member/sigurd4

I'm making the bioshock mod!

Share this post


Link to post
Share on other sites

ItsAMysteriousYT    7

ItsAMysteriousYT

ItsAMysteriousYT    7

  • Dragon Slayer
  • ItsAMysteriousYT
  • Members
  • 7
  • 785 posts
Posted August 29, 2015

Well, thats pretty difficult if you don't extend ItemArmor.

  • Quote

Share this post


Link to post
Share on other sites

sigurd4    0

sigurd4

sigurd4    0

  • Creeper Killer
  • sigurd4
  • Members
  • 0
  • 137 posts
Posted August 29, 2015

yup. that's why i need help.

  • Quote

http://www.planetminecraft.com/member/sigurd4

I'm making the bioshock mod!

Share this post


Link to post
Share on other sites

Failender    119

Failender

Failender    119

  • World Shaper
  • Failender
  • Forge Modder
  • 119
  • 1091 posts
Posted August 29, 2015

I think we already had this here once.. just with a bow. sad story : you need to recreate every enchantment you want for ur ring x)

  • Quote

Share this post


Link to post
Share on other sites

sigurd4    0

sigurd4

sigurd4    0

  • Creeper Killer
  • sigurd4
  • Members
  • 0
  • 137 posts
Posted August 29, 2015

jeez really? i feel like i should suggest for the forge guys to add a hook or something like that for this. but thanks, though. i'll add one for every single vanilla enchantment for now. oh well. :/

 

EDIT: just gonna put this here: http://www.minecraftforge.net/forum/index.php/topic,33408

  • Quote

http://www.planetminecraft.com/member/sigurd4

I'm making the bioshock mod!

Share this post


Link to post
Share on other sites

Failender    119

Failender

Failender    119

  • World Shaper
  • Failender
  • Forge Modder
  • 119
  • 1091 posts
Posted August 29, 2015

well the thing is normally thats not a gud thing. imagine if some1 tries to add a weapon enchantment to an armor? may cause HUGE problems. thats why i think its not in forge and might never be

  • Quote

Share this post


Link to post
Share on other sites

sigurd4    0

sigurd4

sigurd4    0

  • Creeper Killer
  • sigurd4
  • Members
  • 0
  • 137 posts
Posted August 30, 2015

well, it is possible already by using ItemStack.addEnchantment(), but the standard enchantment table can't do it as it will always check if wether or not the enchantment is valid. i don't think it's gonna be a massive problem at all! and if a modder makes some enchantments do some wierd funky stuff then that is on them, not forge. also i used to mess around with changing nbt tags in vanilla to stuff it shouldn't be and, for example, adding enchantments to an item that shouldn't work on it. adding, say, sharpness to a piece of armor will simply increase the damage dealt when you attack with the armor item (lol), nothing crashes or dies horribly in a fire or anything, so don't worry.

  • Quote

http://www.planetminecraft.com/member/sigurd4

I'm making the bioshock mod!

Share this post


Link to post
Share on other sites

sigurd4    0

sigurd4

sigurd4    0

  • Creeper Killer
  • sigurd4
  • Members
  • 0
  • 137 posts
Posted August 30, 2015

i could make my own algoritm for adding random enchantments, though the problem with that is that this algoritm would not be used when the item is enchanted trough an enchantment table, which is kinda what i want.

  • Quote

http://www.planetminecraft.com/member/sigurd4

I'm making the bioshock mod!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • diesieben07
      I can't download 1.16.5 forge

      By diesieben07 · Posted just now

      Some zip managers like to take control of the .jar file extension away from Java. Make sure you have Java installed and try running Jarfix once, then try the installer again.
    • Lil Bub Ben
      I can't download 1.16.5 forge

      By Lil Bub Ben · Posted 5 minutes ago

      I have a windows 10 and every time I download the installer it wouldn't work unless it was a windows installer. and 1.16.5 doesn't have a Win installer. can somebody help me work around this.
    • Twu
      Need help with Potion Brewing recipes

      By Twu · Posted 28 minutes ago

      Thank you so much
    • diesieben07
      1.16.4 Can't connect to server, incomplete server tags.

      By diesieben07 · Posted 58 minutes ago

      I need a server log where the player that cannot connect tried to connect.
    • diesieben07
      The item given to the player disappears

      By diesieben07 · Posted 59 minutes ago

      You are reaching across logical sides. You need to use the living entity given to you and also check World#isRemote to ensure you only modify the inventory on the server.
  • Topics

    • Lil Bub Ben
      1
      I can't download 1.16.5 forge

      By Lil Bub Ben
      Started 5 minutes ago

    • Twu
      2
      Need help with Potion Brewing recipes

      By Twu
      Started 14 hours ago

    • Latobius
      3
      1.16.4 Can't connect to server, incomplete server tags.

      By Latobius
      Started 11 hours ago

    • Hubmac
      1
      The item given to the player disappears

      By Hubmac
      Started 1 hour ago

    • KBomb
      11
      Can't Connect to Forge 1.16.5 Server

      By KBomb
      Started Thursday at 11:58 PM

  • Who's Online (See full list)

    • diesieben07
    • lupicus
    • Unlucky
    • Hubmac
    • Aviator737
    • samjviana
    • Deadlocked47
    • Lil Bub Ben
    • Seika85
    • Pickle_Face5
    • czho
    • SubliminallySublime
    • Luis_ST
    • wilpito
    • Twu
    • NullDev
    • Differentiation
    • Tanguygab
    • blackviper2104
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.8] allow armor specific enchantments for items that don't extend ItemArmor
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community