How to make an advancement that detects an item with an enchantment?

Started by JacksonAnimates on

Topic category: Help with Minecraft modding (Java Edition)

Active 3 years ago
Joined Oct 2021
Points:
526

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 4
How to make an advancement that detects an item with an enchantment?

I'm making this mod for a SMP I host. In the mod there's an achievement that requires you to enchant a Netherite hoe. Is there any way to detect if an item has enchantments in a if-do statement? If there is, could you kindly tell me what it is please, it'd be much appreciated.

Active 1 year ago
Joined Oct 2020
Points:
1617

User statistics:

  • Modifications: 0
  • Forum topics: 15
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1874
if provided itemstack is…
Mon, 10/04/2021 - 16:12

if provided itemstack is enchanted

etc etc

Active 3 years ago
Joined Oct 2021
Points:
526

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 4
That didn't work when I…
Mon, 10/04/2021 - 20:45

That didn't work when I tried it....didn't work when i added = true in there either

 

Active 1 year ago
Joined Oct 2020
Points:
1617

User statistics:

  • Modifications: 0
  • Forum topics: 15
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1874
no not like that, but if…
Mon, 10/04/2021 - 20:54

no not like that, but if Event target entity has ITEM in main inventory AND provided itemstack is enchanted

etc etc

Active 3 years ago
Joined Oct 2021
Points:
526

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 4
Then it says it doesn't know…
Mon, 10/04/2021 - 21:08

Then it says it doesn't know what provided itemstack is, how do I fix that?...?

Active 1 year ago
Joined Oct 2020
Points:
1617

User statistics:

  • Modifications: 0
  • Forum topics: 15
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1874
then replace Itemstack with…
Mon, 10/04/2021 - 21:11

then replace Itemstack with Hoe

Active 1 year ago
Joined Oct 2020
Points:
1617

User statistics:

  • Modifications: 0
  • Forum topics: 15
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1874
just noticed, you didn't…
Mon, 10/04/2021 - 21:11

just noticed, you didn't select right trigger

Active 1 year ago
Joined Oct 2020
Points:
1617

User statistics:

  • Modifications: 0
  • Forum topics: 15
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1874
if none of that works, new…
Mon, 10/04/2021 - 21:14

if none of that works, new procedure:

Player Tick Update

if item in main hand of event target entity = HOE AND provided itemstack is enchanted

etc etc

 

 

Active 3 years ago
Joined Oct 2021
Points:
526

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 4
...It didn't work, neither…
Mon, 10/04/2021 - 21:29

...It didn't work, neither method worked ._.

Active 1 year ago
Joined Oct 2020
Points:
1617

User statistics:

  • Modifications: 0
  • Forum topics: 15
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1874
then on second method change…
Mon, 10/04/2021 - 21:34

then on second method change itemstack to Item in main hand

Active 3 years ago
Joined Oct 2021
Points:
526

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 4
That worked! Thank you!
Mon, 10/04/2021 - 21:48

That worked! Thank you!

Active 1 year ago
Joined Oct 2020
Points:
1617

User statistics:

  • Modifications: 0
  • Forum topics: 15
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1874
:)
Mon, 10/04/2021 - 22:04

:)

Active 3 years ago
Joined Mar 2022
Points:
466

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 12
Thats strange, if you have…
Tue, 04/26/2022 - 16:16

Thats strange, if you have set the procedure in "When item is created" each and everyone of the prcedures should have worked. Well, maybe the first one is the exception.

Active 3 years ago
Joined Mar 2022
Points:
466

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 12
RexCerv, following the topic…
Tue, 04/26/2022 - 16:19

RexCerv, following the topic Do you know how to replace an item wile is begin enchanted with another one? Example. CustomBook in enchanting table is replaced with CustomBookEnchanted with especific enchantments. Or giving the result of CustomBookEnchanted. I didnt see the enchantment option in the "Recipe"option