Deal damage in the name of player

Started by SakePlayS on

Topic category: Help with modding (Java Edition)

Last seen on 16:44, 7. Oct 2023
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Deal damage in the name of player

So bassicly i want to make an item that deals damage in specific block radius and it does deals the damage, however not in the name of player which is means mobs will drop no XP and some mobs wont drop loot of they are required to be killed by player or mob and not something else. Any tips?

Last seen on 18:52, 20. Jan 2022
Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm running into the same…
Sat, 10/09/2021 - 03:40

I'm running into the same issue, did you find any solution?

 

Last seen on 07:56, 23. May 2024
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I don't understand what you…
Sat, 10/09/2021 - 06:50

I don't understand what you need. Please clarify me and I see if I can help

Last seen on 18:52, 20. Jan 2022
Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I mean, the issue I'm having…
Sat, 10/09/2021 - 16:31

I mean, the issue I'm having is that in order to deal a specific amount of damage with a range weapon I did the following:

I set power to 15 to get a decent range and bullet speed for my gun.

I set damage to 0 in order to eliminate the bullet damage.

I created a procedure called "when bullet hit living entity" and set it to "deal [2.68] damage [event/target entity] type=generic" 

This procedure deals that exact amount of damage when hitting a entity, which allows me to avoid the whole balancing power and damage hussle.

I have another procedure that detects when entity dies, which goes as follows:

Under world variable "when entity dies" 

If is [source entity] type player or server player = true

Set [source entity] NBT "Money" to get [source entity] NBT "Money" + 100

This adds 100 "Money" to the player every time it kills a entity.

This works fine for normal attacks, but since the gun's damage is not originated from the player, instead it's generated by the damage procedure, the "player kills entity" procedure doesn't work since the source of the damage is not the player.

So a way to making a procedure that basically deals damage in the name of the player would be extremely useful in this case.