Started by
Otherworldy921
on
Topic category: Help with Minecraft modding (Java Edition)
I am using an older mcreator because I wanted to make a 1.12.2 mod and I wanted to make a sword that gives experience everytime you hit a mob. But, when I did the “when mob is hit with tool” toggle and put the procedure block “add xp to provided player” and it didn’t work when I got into the game. I can’t figure out what I did wrong.
Instead of giving XP to the 'target entity',
insert 'source entity' into the block.
I can't remember if source entity already exists in 1.12.2,
but if it does, try it :D
But, it only lets me do add xp to provided player. There is no way to change it. I thought provided player would refer to the holder of the sword, but I guess not. Maybe it means if I hit a player with it? I want it to give me xp but for some reason it doesn't. I tried attacking mobs and nothing happens. Maybe I should try giving a mob the sword and having them hit me and see what happens
Yes, try it :D
The source entity is the one attacking the target entity.
I think there's a block in Blockly Editor.
I tried it when a zombie had the sword and he hit me and I gained no XP. I don't know why the add xp block isn't working. Also, I would add source entity, but the add xp block doesn't let me change the target. It only says to provided player,
I have an idea :D
You could use commands!
Execute as [source entity] command "/xp @p <amount>"
My bad. I mean "/xp <int> @p"
Thank you! That worked, not sure why I didn't think of that lol