So i tried to make a upgrade station?

Started by EmbodiedKhan91 on Mon, 07/19/2021 - 02:11

Topic category: Help with modding (Java Edition)

Last seen on 21:37, 21. Jul 2021
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
So i tried to make a upgrade station?
Mon, 07/19/2021 - 02:11

I tried to make a station that would give swords an extra level of sharpness that would cost durability on that item so if you had sharpness 2 you would now have sharpness 3 and for example 100 - 200 less durability it depends on the sword but I have made the procedure and when I finished I couldn't use it because it needed certain dependencies and in my opinion it looked very messy. so I just didn't try because I didn't want to be damned to the bottomless pits of figuring out how to fix it without any knowledge what so ever. Here is a few pictures of the horrid creature...

Photo Link since i cant get the photos to work : https://photos.app.goo.gl/JcBr7qEYp2ns1j8e7\\

Anyone have a better way of doing this? or one that might work? or even how to make this procedure work?

Last seen on 09:42, 18. Sep 2021
Joined Apr 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Yes, instead of doing a lot…
Mon, 07/19/2021 - 05:29

Yes, instead of doing a lot of if checks for level of enchantment you can simply just apply sharpness enchantment with level of protection enchantment + 1

Last seen on 21:37, 21. Jul 2021
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
thanks i didn't even think…
Mon, 07/19/2021 - 13:10

thanks i didn't even think of that

Last seen on 21:37, 21. Jul 2021
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
It appears the new problem…
Mon, 07/19/2021 - 14:46

It appears the new problem is it instead of upgrading sharpness 1 to sharpness 2 it just gives it another enchant of sharpness 2 so it has both and then because of that it stops going up in sharpness levels just giving me infinite sharpness 2 enchants all seperate.

Last seen on 10:27, 3. Aug 2021
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Could you send an example of…
Mon, 07/19/2021 - 16:47

Could you send an example of what you're talking about?

Last seen on 10:27, 3. Aug 2021
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Here's what I did: First, I…
Mon, 07/19/2021 - 19:27

Here's what I did:

First, I checked if the item in slot 0 was a sword, and checked if the item in slot 1 was quartz. Then, I checked if the sword had sharpness 4 or lower and had over 50 durability left. If those conditions were met, then I stored the level of sharpness + 1 as a variable. Then, I removed 1 quartz from slot 1 and removed the sharpness from the sword in slot 0. Finally, I enchanted the sword in slot 0 with the sharpness level of the variable, and dealt 50 damage to the sword.

This can probably be adapted to your situation. The main part is storing the sharpness level plus one as a variable, removing the sharpness, and then adding the sharpness enchantment with the sharpness level in the variable.

Procedure:

(Picture of procedure)