Started by
intheend
on
Topic category: Help with Minecraft modding (Java Edition)
Idea: When right clicked spawning particles and damage entity on radius 5 blocks around the player
That's how I realize it (i didn't figure out how to upload photos, so I'll describe it in text):
spawn particles on server side in area
if not is event/target entity (sub) type player
do for each entity as entity iterator at x y z in square cub with size 5
do deal 15 damage to event/target entity from source Damage source of type PLAYER_ATTACK
Cooldown Proviced itemstack for 100 ticks for event/target entity
particles spawning, but mobs doesnt hit
if i delete words about player damage start work only in player, mobs around doesnt hit
Okay, I see what you need to change
The particles and cooldown are fine as they are, but you need to move the if block inside the for each block, instead of the other way around. And you need to use the entity iterator block instead of event/target entity for the if block and the damage block.
It will look something like this:
spawn particles on server side in area
for each entity as entity iterator at x y z in square cub with size 5
do if not is entity iterator (sub) type player
do deal 15 damage to entity iterator from source Damage source of type PLAYER_ATTACK
Cooldown Proviced itemstack for 100 ticks for event/target entity
That should work