#How do i test for a hit

1 messages · Page 1 of 1 (latest)

golden mirage
#

how do i make it so that every 1/10 hit with the item: minecraft:carrot_on_a_stick[minecraft:custom_data={fire_gem:1b}] will set the entity it hit on fire in 1.21.1

obsidian valeBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

🙇 If nobody has answered you by <t:1733690590:t>, feel free to use the Summon Helpers button to ping our helper team.

✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve

solar panther
#

Do you have a way of detecting the hit currently?

golden mirage
#

no

solar panther
#

Do you want to use a custom enchantment, or would you prefer not to?

golden mirage
#

prefer not

#

i would prefer to use a scoreboard

#

or smth

solar panther
#

It's not necessarily a big difference in ease, just a question of if you want the item to be enchantable otherwise

#

An enchantment would be easier

golden mirage
#

what does an enchantment mean?

#

the item already comes with unbreaking 1

solar panther
#

Exactly what it sounds like, making a custom enchantment

#

You can make it unavailable in the enchanting table so that it's unique to this item

solar panther
golden mirage
#

ok

#

so how would i make it an enchantment

solar panther
#

You can use this generator
https://misode.github.io/enchantment/

The resulting JSON file will go in your data pack in <namespace>/enchantment, and then you can apply it to the item with an enchantment component.

golden mirage
solar panther
#

Luckily that's what we're here for

#

You're going to make an enchantment that has a Post Attack effect, then does an Ignite effect for whatever duration you want. Make it work so that the Enchanted entity is the attacker, and the Affected entity is the victim. Finally, you'll add a Requirements object, which will let you set a Random chance condition, which you can set to a Float of 0.1, aka 10%

golden mirage
solar panther
#

Good start, now hit that + button beside the post attack

golden mirage
#

and select what one

golden mirage
#

there is no "ignite" option

solar panther
#

Show your work

golden mirage
solar panther
#

Don't know what you added the fishing time reduction for

golden mirage
#

lol i couldnt find ignite

solar panther
#

But hit the + that is right next to the post attack

golden mirage
#

yeah

solar panther
#

So what does that do?

golden mirage
solar panther
#

Wow crazy

golden mirage
#

change affected to victim?

solar panther
#

Yep

golden mirage
#

donwe

#

now how do i make it a 1/10

golden mirage
#

mb

#

ok but how do i remove it from enchantment tables

solar panther
#

You don't need to do anything for that, by default enchantments are in enchanting tables, you have to intentionally add it

golden mirage
#

oh ok

#

so now i add it to the folder and weapon

solar panther
#

Yep

golden mirage
#

do i name it the blaze.json

solar panther
#

If you like

golden mirage
#

but when i do this it doesnt work

#

/give @s minecraft:carrot_on_a_stick[minecraft:enchantments={levels:{"gemstone:blaze":1}}]

#

(gemstone is my namespace)

solar panther
#

In what way doesn't it work?

golden mirage
#

it gives me an error

solar panther
#

It's missing the level

golden mirage
#

@solar panther

solar panther
#

Not immediately sure then, have to step away

#

Clearly the syntax is wrong

golden mirage
#

/give @s minecraft:carrot_on_a_stick[minecraft:enchantments={levels:{"gemstone:blaze":1}}] what?