I've noticed that I can't increase the damage done by a Llama's spit by adjusting the Llama entity so I guess I should adjust the llama_spit entity directly, but I'm not sure how to go about this. What are the paramaters I can even change of the llama_spit entity and in what way would I increase it's damage? The intent is for all Llama's to be stronger so there's no need to target a specific llama_spit. Does anyone know how I can do this?
I've noticed that I can't increase the damage done by a Llama's spit by adjusting the Llama entity so I guess I should adjust the llama_spit entity directly, but I'm not sure how to go about this. What are the paramaters I can even change of the llama_spit entity and in what way would I increase it's damage? The intent is for all Llama's to be stronger so there's no need to target a specific llama_spit. Does anyone know how I can do this?
I believe the spit's damage is hard-coded like snowballs and lava.
You prob need commands to inflict other types of damage to victims when the spit is near the player.
You probably know how to do them so I don't rly need to give the code. But I can suggest explosive spits~
Thanks for the response, actually I'm unsure about the code. I was playing around with activating a effect to entities near the llama_spit (like instant damage) which works fine from a distance but when the entity is too close to the Llama when he spits it doesn't work. My guess is there's not enough time between the spit and the hit for the code to activate? The code I'm using right now for that is:
execute as @e[type=minecraft:llama_spit] at @s run effect give @e[type=!minecraft:llama_spit,type=!minecraft:llama,distance=..3] minecraft:instant_damage 1
Another possibility I was thinking about is adding an arrow with the same motion but then I'd have to transfer the motion and I don't really know how to do that. Possibly via scoreboards?
Thanks for the response, actually I'm unsure about the code. I was playing around with activating a effect to entities near the llama_spit (like instant damage) which works fine from a distance but when the entity is too close to the Llama when he spits it doesn't work. My guess is there's not enough time between the spit and the hit for the code to activate? The code I'm using right now for that is:
execute as @e[type=minecraft:llama_spit] at @s run effect give @e[type=!minecraft:llama_spit,type=!minecraft:llama,distance=..3] minecraft:instant_damage 1
Another possibility I was thinking about is adding an arrow with the same motion but then I'd have to transfer the motion and I don't really know how to do that. Possibly via scoreboards?
Well, basically your code there works well. Problem is that when the llama is right next to the entity, the spit hits the target before the command can run anything.
If you need that fixed, all I can think of is advancements (using the trigger minecraft:entity_hurt_player). However, I've never used it.
The instant damage is not really working out for me cause I need it to damage all kinds of mobs.
I did however manage to make explosive llama spit which is actually really cool and useful, good tip :)!
I still want to try a different approach as well though.
Do you know how to summon an entity (say an arrow) to the location of the llama_spit and make it have the same motion? I've tried it but can't seem to figure it out.
The instant damage is not really working out for me cause I need it to damage all kinds of mobs.
I did however manage to make explosive llama spit which is actually really cool and useful, good tip :)!
I still want to try a different approach as well though.
Do you know how to summon an entity (say an arrow) to the location of the llama_spit and make it have the same motion? I've tried it but can't seem to figure it out.
I believe you summon a normal arrow and store the llama spit's Motion tag to the arrow using /execute store. The visual display of the arrow might be strange tho...
I believe you summon a normal arrow and store the llama spit's Motion tag to the arrow using /execute store. The visual display of the arrow might be strange tho...
I've tried it but couldn't get it to work. Right now there are arrows summoned every tick the llama_spit is flying and the arrows just fall down from where they spawned, untill the llama_spit has dissapeared, then they go back into place in the air where they first spawned and stay in place hovering in the air.
This is the code I'm running at the moment. I don't fully understand how the 'store' and 'data get' commands work so I tried to copy something of another code I saw.
These first 3 are command blocks set to repeat/unconditional/always active:
execute if entity @e[tag=llamaspit] run function targetmobs:llamaspit
execute if entity @e[type=minecraft:llama_spit] as @e[type=minecraft:llama_spit] run execute store result score @s llamaspitmotion run data get entity @s Motion[1]
execute at @e[type=minecraft:llama_spit] run summon minecraft:arrow ~ ~ ~ {Tags:[llamaspit]}
This is the function targetmobs:llamaspit
execute if entity @e[tag=llamaspit] as @e[tag=llamaspit] run execute store result entity @s Motion[1] double 1 run scoreboard players get @s llamaspitmotion
I've tried it but couldn't get it to work. Right now there are arrows summoned every tick the llama_spit is flying and the arrows just fall down from where they spawned, untill the llama_spit has dissapeared, then they go back into place in the air where they first spawned and stay in place hovering in the air.
This is the code I'm running at the moment. I don't fully understand how the 'store' and 'data get' commands work so I tried to copy something of another code I saw.
These first 3 are command blocks set to repeat/unconditional/always active:
execute if entity @e[tag=llamaspit] run function targetmobs:llamaspit
execute if entity @e[type=minecraft:llama_spit] as @e[type=minecraft:llama_spit] run execute store result score @s llamaspitmotion run data get entity @s Motion[1]
execute at @e[type=minecraft:llama_spit] run summon minecraft:arrow ~ ~ ~ {Tags:[llamaspit]}
This is the function targetmobs:llamaspit
execute if entity @e[tag=llamaspit] as @e[tag=llamaspit] run execute store result entity @s Motion[1] double 1 run scoreboard players get @s llamaspitmotion
It should... be something like this:
execute at @e[type=minecraft:llama_spit,tag=!sharp] run summon minecraft:arrow ~ ~ ~ {Tags:["llamaspit"],Motion:[0.0,0.0,0.0]}
execute at @e[tag=llamaspit] run tag @e[type=llama_spit,tag=!sharp,distance=..1] add sharp
execute as @e[tag=llamaspit] at @s if entity @e[distance=..2,tag=sharp] store result entity @s Motion[0] double 1 run data get entity @e[limit=1,sort=nearest,tag=sharp] Motion[0]
execute as @e[tag=llamaspit] at @s if entity @e[distance=..2,tag=sharp] store result entity @s Motion[1] double 1 run data get entity @e[limit=1,sort=nearest,tag=sharp] Motion[1]
execute as @e[tag=llamaspit] at @s if entity @e[distance=..2,tag=sharp] store result entity @s Motion[2] double 1 run data get entity @e[limit=1,sort=nearest,tag=sharp] Motion[2]
execute at @e[type=minecraft:llama_spit,tag=!sharp] run summon minecraft:arrow ~ ~ ~ {Tags:["llamaspit"],Motion:[0.0,0.0,0.0]}
execute at @e[tag=llamaspit] run tag @e[type=llama_spit,tag=!sharp,distance=..1] add sharp
execute as @e[tag=llamaspit] at @s if entity @e[distance=..2,tag=sharp] store result entity @s Motion[0] double 1 run data get entity @e[limit=1,sort=nearest,tag=sharp] Motion[0]
execute as @e[tag=llamaspit] at @s if entity @e[distance=..2,tag=sharp] store result entity @s Motion[1] double 1 run data get entity @e[limit=1,sort=nearest,tag=sharp] Motion[1]
execute as @e[tag=llamaspit] at @s if entity @e[distance=..2,tag=sharp] store result entity @s Motion[2] double 1 run data get entity @e[limit=1,sort=nearest,tag=sharp] Motion[2]
That works! An arrow is summoned in the same motion and flies with the llama_spit, the arrow just doesn't do any damage though. Is there an nbt tag that should be added? I tried adding damage:5.0 to the summoned arrow but it didn't have any effect.
That works! An arrow is summoned in the same motion and flies with the llama_spit, the arrow just doesn't do any damage though. Is there an nbt tag that should be added? I tried adding damage:5.0 to the summoned arrow but it didn't have any effect.
damage:5.0 should work.
One possibility is that the llama spit hits before the arrow.
If that's the case, simply kill the llama_spit after the arrow gets its Motion. The llama spit has its own particle effect.
One possibility is that the llama spit hits before the arrow.
If that's the case, simply kill the llama_spit after the arrow gets its Motion. The llama spit has its own particle effect.
Wait a minute.. I tried it without killing the arrow when it's in the ground so I could see where it lands and the arrow doesn't follow the llama spit all that well.. It just takes it's own course and drops down almost immediatly, never even having a chance of hitting the target. Somehow the motion is not transferred over from the llama_spit to the arrow perfectly. I haven't changed anything from your code appart from deleting the kill arrow line. Do you maybe know how to fix it?
Wait a minute.. I tried it without killing the arrow when it's in the ground so I could see where it lands and the arrow doesn't follow the llama spit all that well.. It just takes it's own course and drops down almost immediatly, never even having a chance of hitting the target. Somehow the motion is not transferred over from the llama_spit to the arrow perfectly. I haven't changed anything from your code appart from deleting the kill arrow line. Do you maybe know how to fix it?
Well, that /execute store command has its flaws. If the store part is executed but they get nothing, it'll simply put a 0.
The exploding llama_spit is a great solution actually.
Thanks a lot for the effort! If I may ask, why is it impossible? Is it because of the motion tag, the arrow or the llama_spit? Because if it IS possible with snowballs instead of llama_spit then that would help me out a lot as well. (the goal would be to make the snow golem's snowballs do damage to other mobs)
The exploding llama_spit is a great solution actually.
Thanks a lot for the effort! If I may ask, why is it impossible? Is it because of the motion tag, the arrow or the llama_spit? Because if it IS possible with snowballs instead of llama_spit then that would help me out a lot as well. (the goal would be to make the snow golem's snowballs do damage to other mobs)
Basically the llama_spit is too fast for the arrow to follow. The arrow will only travel mid-way b4 the spit hits the player.
That's what makes it impossible using commands. If you get what I mean... ; >
Hmm... It feels a bit quiet here. Did you try the datapack I attached in the Spoiler?
Excuse me, in the weekends I don't always have time to work on Minecraft ;). I tried it, and it works perfectly on a player. BUT the goal was never for the Llama to be stronger against players but against other mobs. I might not have been too clear about that.. So whilst this method is pretty brilliantly implemented and I wanna thank you for that, I can't use it unfortunately.
Like I said before, the explosive spit (which I have working) actually fulfills the purpose quite nicely so I'm happy to settle for that. Only thing I don't like about it is that I can't make the Creeper completely invisible cause of invisibility effect lag. (I'm using a Creeper instead of TNT because I need the terrain to stay undamaged and I have /mobgrieving set to false anyway)
Excuse me, in the weekends I don't always have time to work on Minecraft ;). I tried it, and it works perfectly on a player. BUT the goal was never for the Llama to be stronger against players but against other mobs. I might not have been too clear about that.. So whilst this method is pretty brilliantly implemented and I wanna thank you for that, I can't use it unfortunately.
Like I said before, the explosive spit (which I have working) actually fulfills the purpose quite nicely so I'm happy to settle for that. Only thing I don't like about it is that I can't make the Creeper completely invisible cause of invisibility effect lag. (I'm using a Creeper instead of TNT because I need the terrain to stay undamaged and I have /mobgrieving set to false anyway)
If the invisible delay is the issue, then simply delay the explosion.
So it's like, when it approaches an entity, summon an armor stand and an ignited creeper at y:-2, wait for like 10 ticks, then teleport the creeper upwards and kill the armor stand.
Also, didn't know it has to be entity to entity, sorry bout that : p
If the invisible delay is the issue, then simply delay the explosion.
So it's like, when it approaches an entity, summon an armor stand and an ignited creeper at y:-2, wait for like 10 ticks, then teleport the creeper upwards and kill the armor stand.
Also, didn't know it has to be entity to entity, sorry bout that : p
I don't really get what you mean, I have this as the code right now in a function:
(I did remove the invisibility effect earlier because it didn't work)
execute as @e[type=llama_spit] at @s run kill @e[tag=spit,distance=..2]
execute at @e[tag=spit] if entity @e[type=llama,distance=7..] as @e[tag=spit] run summon creeper ~ ~ ~ {Silent:1,ExplosionRadius:3,Fuse:0,ignited:1}
kill @e[tag=spit]
execute as @e[type=llama_spit] at @s run summon minecraft:area_effect_cloud ~ ~ ~ {Duration:2,Tags:[spit]}
I've noticed that I can't increase the damage done by a Llama's spit by adjusting the Llama entity so I guess I should adjust the llama_spit entity directly, but I'm not sure how to go about this. What are the paramaters I can even change of the llama_spit entity and in what way would I increase it's damage? The intent is for all Llama's to be stronger so there's no need to target a specific llama_spit. Does anyone know how I can do this?
I believe the spit's damage is hard-coded like snowballs and lava.
You prob need commands to inflict other types of damage to victims when the spit is near the player.
You probably know how to do them so I don't rly need to give the code. But I can suggest explosive spits~
Thanks for the response, actually I'm unsure about the code. I was playing around with activating a effect to entities near the llama_spit (like instant damage) which works fine from a distance but when the entity is too close to the Llama when he spits it doesn't work. My guess is there's not enough time between the spit and the hit for the code to activate? The code I'm using right now for that is:
Another possibility I was thinking about is adding an arrow with the same motion but then I'd have to transfer the motion and I don't really know how to do that. Possibly via scoreboards?
Well, basically your code there works well. Problem is that when the llama is right next to the entity, the spit hits the target before the command can run anything.
If you need that fixed, all I can think of is advancements (using the trigger minecraft:entity_hurt_player). However, I've never used it.
The instant damage is not really working out for me cause I need it to damage all kinds of mobs.
I did however manage to make explosive llama spit which is actually really cool and useful, good tip :)!
I still want to try a different approach as well though.
Do you know how to summon an entity (say an arrow) to the location of the llama_spit and make it have the same motion? I've tried it but can't seem to figure it out.
I believe you summon a normal arrow and store the llama spit's Motion tag to the arrow using /execute store. The visual display of the arrow might be strange tho...
I've tried it but couldn't get it to work. Right now there are arrows summoned every tick the llama_spit is flying and the arrows just fall down from where they spawned, untill the llama_spit has dissapeared, then they go back into place in the air where they first spawned and stay in place hovering in the air.
This is the code I'm running at the moment. I don't fully understand how the 'store' and 'data get' commands work so I tried to copy something of another code I saw.
These first 3 are command blocks set to repeat/unconditional/always active:
This is the function targetmobs:llamaspit
It should... be something like this:
execute at @e[type=minecraft:llama_spit,tag=!sharp] run summon minecraft:arrow ~ ~ ~ {Tags:["llamaspit"],Motion:[0.0,0.0,0.0]}
execute at @e[tag=llamaspit] run tag @e[type=llama_spit,tag=!sharp,distance=..1] add sharp
execute as @e[tag=llamaspit] at @s if entity @e[distance=..2,tag=sharp] store result entity @s Motion[0] double 1 run data get entity @e[limit=1,sort=nearest,tag=sharp] Motion[0]
execute as @e[tag=llamaspit] at @s if entity @e[distance=..2,tag=sharp] store result entity @s Motion[1] double 1 run data get entity @e[limit=1,sort=nearest,tag=sharp] Motion[1]
execute as @e[tag=llamaspit] at @s if entity @e[distance=..2,tag=sharp] store result entity @s Motion[2] double 1 run data get entity @e[limit=1,sort=nearest,tag=sharp] Motion[2]
kill @e[type=arrow,tag=llamaspit,nbt={inGround:1b}]
All repeating. Give it a try.
That works! An arrow is summoned in the same motion and flies with the llama_spit, the arrow just doesn't do any damage though. Is there an nbt tag that should be added? I tried adding damage:5.0 to the summoned arrow but it didn't have any effect.
damage:5.0 should work.
One possibility is that the llama spit hits before the arrow.
If that's the case, simply kill the llama_spit after the arrow gets its Motion. The llama spit has its own particle effect.
Wait a minute.. I tried it without killing the arrow when it's in the ground so I could see where it lands and the arrow doesn't follow the llama spit all that well.. It just takes it's own course and drops down almost immediatly, never even having a chance of hitting the target. Somehow the motion is not transferred over from the llama_spit to the arrow perfectly. I haven't changed anything from your code appart from deleting the kill arrow line. Do you maybe know how to fix it?
Well, that /execute store command has its flaws. If the store part is executed but they get nothing, it'll simply put a 0.
I'll take a look at it after my mid-term exam.
Much appreciated. And good luck on your exam!
Ok. I realized that it's simply impossible to make the arrow land on the player every time.
So it's sad to say... but...
I have to move on and use Advancements. Took me time to study about it.
Here's the datapack folder http://www.mediafire.com/file/ujhas4ck984dcjh/trash.zip/file. It can run by itself.
I also tested it. Currently it deals 6 hearts (aka 12 points) of damage.
It's flawless, but feels strange when the spit sticks arrows on the player.
All you need to do is to summon a llama with the tag "Sharp", then you're set.
Note that players won't take damage if they hug the llama, it's vanilla bug.
Again, sorry about that. Hope you can find your solution.
That's really OK, it's not your fault
The exploding llama_spit is a great solution actually.
Thanks a lot for the effort! If I may ask, why is it impossible? Is it because of the motion tag, the arrow or the llama_spit? Because if it IS possible with snowballs instead of llama_spit then that would help me out a lot as well. (the goal would be to make the snow golem's snowballs do damage to other mobs)
Basically the llama_spit is too fast for the arrow to follow. The arrow will only travel mid-way b4 the spit hits the player.
That's what makes it impossible using commands. If you get what I mean... ; >
Hmm... It feels a bit quiet here. Did you try the datapack I attached in the Spoiler?
Excuse me, in the weekends I don't always have time to work on Minecraft ;). I tried it, and it works perfectly on a player. BUT the goal was never for the Llama to be stronger against players but against other mobs. I might not have been too clear about that.. So whilst this method is pretty brilliantly implemented and I wanna thank you for that, I can't use it unfortunately.
Like I said before, the explosive spit (which I have working) actually fulfills the purpose quite nicely so I'm happy to settle for that. Only thing I don't like about it is that I can't make the Creeper completely invisible cause of invisibility effect lag. (I'm using a Creeper instead of TNT because I need the terrain to stay undamaged and I have /mobgrieving set to false anyway)
If the invisible delay is the issue, then simply delay the explosion.
So it's like, when it approaches an entity, summon an armor stand and an ignited creeper at y:-2, wait for like 10 ticks, then teleport the creeper upwards and kill the armor stand.
Also, didn't know it has to be entity to entity, sorry bout that : p
I don't really get what you mean, I have this as the code right now in a function:
(I did remove the invisibility effect earlier because it didn't work)
execute as @e[type=llama_spit] at @s run kill @e[tag=spit,distance=..2]
execute at @e[tag=spit] if entity @e[type=llama,distance=7..] as @e[tag=spit] run summon creeper ~ ~ ~ {Silent:1,ExplosionRadius:3,Fuse:0,ignited:1}
kill @e[tag=spit]
execute as @e[type=llama_spit] at @s run summon minecraft:area_effect_cloud ~ ~ ~ {Duration:2,Tags:[spit]}