! Make player damage targeted entity?

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

NonicPvP

New Member
Mar 23, 2017
9
1
3
Denmark
Hey:emoji_slight_smile:

I have this code and I would like to make the player damage the targeted player.
Problem is that this code does not make the player the attacker, it just damages the targeted player as if nothing hit them

I have tried:
force player to damage entity of player by 4
make player damage entity of player by 4
Searching the docs...


Code:
        if target entity of player is set:
            if sharpsk region at player is not "Lobby":
                damage target entity of player by 4
        if sharpsk region at player is not "Lobby":
            loop all entities in radius 2 of {_block}:
                damage loop-entity by 4

Any solution/separate way?
 
You can use the Force Attack effect for this.
Code:
make player attack target entity of player

If you want them to be damaged by 4 specifically, you could set the player's 'generic attack damage' attribute.
 
You can use the Force Attack effect for this.
Code:
make player attack target entity of player

If you want them to be damaged by 4 specifically, you could set the player's 'generic attack damage' attribute.

Yes, that actually seems to function but requires Minecraft 1.15.2 or higher. I probably should have mentioned this is 1.8
 
Status
Not open for further replies.