#How can i give enchantments to mobs?
1 messages · Page 1 of 1 (latest)
<@&1201956957406109788>
💬 While you wait, take this time to provide more context and details.
🙇 After a while, hit the Summon Helpers button to ping the helper team. They'll be happy to help you
✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve
I get stucked trying to give a skeleton punch 10
i know punch 10 exists because i can /give it
wdym give to mobs?
like
when they spawn, with the tick function you can give them effects or attributes
i know that two
Do you want to summon a mob with an item or give an item in the mob's hand?
but i dont know how to make
example: all skeletons spawn with their bow with Punch 10
like the same weapon but with another enchantment
just use the command /enchant
i cant enchant a mob with punch 10
it says that the limit is 2
but i know punch 10 exist in the game
1.20.4
data modify entity @s HandItems[0].tag.Enchantments append value {id:"minecraft:punch",lvl:10}
thats it?
hm yes
check the command if you remove 0 from [0] to change both hands
data modify entity @s HandItems[].tag.Enchantments append value {id:"minecraft:punch",lvl:10}
when a cave spider hits you, it gives you the poison effect.
Is there a way to have another mob give you an effect, say nausea when it hits you?
for example when a zombie hits you
it gives you nausea
I don't know if you understand what I'm saying
use the achievement with the entity hurt player trigger
for example?
misode generator
i didn't know misode have that
Have you ever used advancements?
nope
{
"criteria": {
"requirement": {
"trigger": "minecraft:entity_hurt_player",
"conditions": {
"damage": {
"source_entity": {
"type": "minecraft:husk"
}
}
}
}
},
"rewards": {
"function": "namespace:name"
}
}
@mighty ore
im here
that gives hunger?
I say it for the husk
you need to use /effect in the defined function for it to give hunger
as a reward, the function is called as and at a player, in the function you need to remove the advancement and you can give an effect with the command /effect
is called as a nickname of a player?
yea basically
That's what it does
yea
i dont understand that part
this
.
├── pack.mcmeta
├── pack.png
└── data
└── <namespace>
├── advancements
├── functions
├── item_modifiers
├── loot_tables
├── predicates
├── recipes
├── structures
├── chat_type
├── damage_type
├── tags
│ ├── blocks
│ ├── entity_types
│ ├── fluids
│ ├── functions
│ ├── game_events
│ ├── items
│ ├── chat_type
│ └── damage_type
├── dimension
├── dimension_type
└── worldgen
├── biome
├── configured_carver
├── configured_feature
├── density_function
├── noise
├── noise_settings
├── placed_feature
├── processor_list
├── structure
├── structure_set
├── template_pool
├── world_preset
└── flat_level_generator_preset
```
you put this in a .json file in the advancements folder
Yap
call ir whatever you want
Not quite sure whaz you mean
its a little stupid question but im really confused on that part
like
for example
im with my friend
and my friend get hurt by the mob that gives hunger
then i have to erase someting?
something*
and replace "namespace:name" in this template with the name of that function
the name of the function is specific?
and in that function you make it remove the advancement from the player
yea
so the pack knows which function to call
advancement revoke?
yap
so what can i put for the name?
whatever you want to call it
yea for example
can you give me an example for the advancemnet revoke command?
I'm not very familiar with that
advancement (grant|revoke) <targets> everything
Adds or removes all loaded advancements.
advancement (grant|revoke) <targets> only <advancement> [<criterion>]
Adds or removes a single advancement or criterion.
advancement (grant|revoke) <targets> from <advancement>
Adds or removes an advancement and all its child advancements.
Think of specifying everything from that advancement to the end.
The exact order the operation is carried out in is specified advancement > child > child's child > ... When it operates on a child that branches, it iterates through all its children before continuing.
advancement (grant|revoke) <targets> through <advancement>
Specifies an advancement, and adds or removes all its parent advancements, and all its child advancements.
Think of specifying everything through the specified advancement, going both backwards and forwards.
The exact order the operation is as if the command were executed with "until" specified, then with "from" specified: parent > parent's parent > ... > root > specified advancement > child > child's child > ...
advancement (grant|revoke) <targets> until <advancement>
Adds or removes an advancement and all its parent advancements until the root for addition/removal.
Think of specifying everything from the start until that advancement.
The exact order the operation is carried out in is: parent > parent's parent > ... > root > specified advancement.
advancement revoke @s only namespace:advancement
Where you replace namespace:advancement with your namespace and the name of the advancement file
the namespace is the ''papu'' one right?
yep
[35madvancement [34mrevoke [36m@s [34monly [33mnamespace:advancement_name
the advancement_name
what would it be?
okay okay thank you really much
Always happy to help :))
wait i get confused with something
on the advancements file
i put the .json
and the .mcfunction?
or I have to make a file to separate them?
@weary prairie
maybe i sleep soon if that happens i will come back
no both are seperate files
it has a comma?
or You are saying that both are in the same file
qhat?
no
they are both
in different files
one in the advancements folder
the other one in the functions folder
lmao
XD
no
not in the advancements folder
besides it
Did you get it to work? :)
i just have to modify the ''namspace: name'' ?
sorry it was too late when i was conected yesterday
i think im missing something
i put the stuff you told me but
What do you mean when you say use the /effect, so where do I have to put that?
namespace folder is located in data folder
just specify the path to the function
in the function
. /effect @s poison (time) (level) ?
without the / i think
oh and how the game will know i want a spider gives that effect
the function
the json
Yap
oh okay
together?
well i suppose is separated
what are those points under the ''papu''?
yea
that its incomplete
you need to
remoce the space
and the .json
yass
well
wait
yea
one sec
{
"criteria": {
"requirement": {
"trigger": "minecraft:entity_hurt_player",
"conditions": {
"damage": {
"source_entity": {
"type": "minecraft:cave_spider"
}
}
}
}
},
"rewards": {
"function": "papu:hurteffect"
}
}
this should work
oh wait
nvm
its specified there
"type": "minecraft:husk"
if you want a different entity you just need to change it
oh okay
and its the same process if i want to make another mob with another effect when hits right?
yap
nope
where is the function file
in what folder
can you send the entire pack? :P
Maybe try revoking the advancement manually, if you got it and didn't revoke it, you can't get it again
try this
try revoking it in chat
can you send the entire pack here
yea that should work
lemme try
/advancement revoke @s only papu:cavespider
run this in chat
should fix it
that's also what gears said :P
it says that i dont have it
@weary prairie IT WORK
I JUST ERASE AND PUT AGAIN THE DATAPACK
thats strange
oh and i want to make a final question
how can i give to
for example
all drowned
a trident
i was thinking on the tick function but i suppose it will crash or something
Also it won't let me XD
Psst, <@&935561184806060073>!
ill have to leave for now maybe sb else can help with the ohter question :)
seriously thanks, I literally just made a wither zombie in 10 seconds with no difficulty
no problem
😉
You can insert a trident in all untagged drowneds hands with the /item replace command
like this?
Use weapon.mainhand as the slot
I don't recommend this. Do it similar to the ghast. Otherwise it will replace every drowned hand item with a trident every tick. Even if they already have a trident.
This can potentially cause a lot of lag
this one is the tick function
lol it work
/resolved
uhh
i dont remember that command
Your question, #1240959831217541171 (How can i give enchantments to mobs?), was resolved!
#1240959831217541171 message
1d1h42m