How to make an arrow that upon hitting a player steals xp and gives it to the player who shot it?

Started by AlfonixJohnson on

Topic category: Help with Minecraft modding (Java Edition)

Joined Nov 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make an arrow that upon hitting a player steals xp and gives it to the player who shot it?

I tried and couldn't get it to work but I could do it on a sword

Joined Nov 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i did remove both of those;…
Fri, 11/21/2025 - 23:28

i did remove both of those; still does not work

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It should be working…
Sat, 11/22/2025 - 00:22

It should be working... Could you provide a screenshot of the procedure? Preferably using imgur or similar sites.

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Just to let you know, XP is…
Sat, 11/22/2025 - 02:13

Just to let you know, XP is different from XP levels, but also you are shooting the custom projectile from your item/ranged weapon right?

Joined Nov 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
from a regular bow
Sat, 11/22/2025 - 02:50

from a regular bow

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Unless you have another…
Sun, 11/23/2025 - 00:39

Unless you have another procedure to replace that arrow, or shoot when using the bow then it won't work, I assume you're using the tags to let your custom projectile be used by normal bows like arrows, but the custom triggers have never seemed to work with that method for me, not sure about the newest version however.

Joined Nov 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So its just not possible?
Sun, 11/23/2025 - 13:59

So its just not possible?

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It is possible, This is…
Mon, 11/24/2025 - 07:07

It is possible, This is something I used to detect any arrows being shot from a bow, and then changing that projectile to a different one.

In the for each slot in inventory, have it only check for your arrow, and then set the local variable to that arrow.
Then check if that variable is equal to your arrow, and select your custom projectile to shoot you can change any parameters you'd like, however if you want it to have the same range and speed as a normal arrow do not change the speed.
https://imgur.com/a/I9Blcw5 

Joined Nov 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So wait, I would need to…
Tue, 11/25/2025 - 01:02

So wait, I would need to make another custom arrow for this to work right

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
That is correct, I assumed…
Tue, 11/25/2025 - 01:05

That is correct, I assumed that is what you were trying to do. However if you want this to be done with a normal arrow, you can use the very first procedure I showed, you'd just need to change that very first if statement to try and get working, this has to be in it's own procedure as well.

Joined Nov 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Also I cant find "set or get…
Tue, 11/25/2025 - 01:09

Also I cant find "set or get itemstack local savefirst"

Joined Nov 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I want it only on my custom…
Tue, 11/25/2025 - 01:10

I want it only on my custom arrow

 

Joined Nov 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
this is what I have
Tue, 11/25/2025 - 01:48

this is what I have