1
Add Lore To Held Item?
In my exercise datapack, i have a custom item called a Dumbbell, which can be used for long periods of time to make the player stronger, (by giving them a permanent strength effect), but i wanted to make it so Dumbbells with different weights gave the player a more and more powerful strength effect.
The way you would make the Dumbbell heavier is by holding it in your main hand, holding a Weight in your off hand, and right-clicking the Dumbbell while crouching.
I wanted to show the different weights by having the lore/description show the weight in Creepers, (0.5 Creepers, 1 Creeper, 5 Creepers, ect.), and i want it to be changeable.
I tried looking online, but i couldn't find anything for changing the lore of the item the player is holding, or even anything for changing the lore of items.
Is this even possible? If so, how would i go about doing it, and if not what could i do instead?
Any help would be greatly appreciated!
P.S, i need some ideas for Speed, Jump Boost, Resistance, Dolphin's Grace, other positive effects, and the name of the datapack, (i was thinking Bloxersise?), so leave any minecrafty, exercise-related ideas below!
The way you would make the Dumbbell heavier is by holding it in your main hand, holding a Weight in your off hand, and right-clicking the Dumbbell while crouching.
I wanted to show the different weights by having the lore/description show the weight in Creepers, (0.5 Creepers, 1 Creeper, 5 Creepers, ect.), and i want it to be changeable.
I tried looking online, but i couldn't find anything for changing the lore of the item the player is holding, or even anything for changing the lore of items.
Is this even possible? If so, how would i go about doing it, and if not what could i do instead?
Any help would be greatly appreciated!
P.S, i need some ideas for Speed, Jump Boost, Resistance, Dolphin's Grace, other positive effects, and the name of the datapack, (i was thinking Bloxersise?), so leave any minecrafty, exercise-related ideas below!
Create an account or sign in to comment.
4
Modifying an item can be done with an item_modifier in data packs (https://minecraft.wiki/w/Item_modifier). This is an amazing generator to help with creating them: https://misode.github.io/item-modifier/.
Helpfully there is a set_lore function for you! You'll need Entity set to "this" and Replace set to "true", and then you can add whatever lore you like. Once you're done, it goes in data > namespace > item_modifiers. To apply it to your item you'd run the command:
Hope that helps!
Helpfully there is a set_lore function for you! You'll need Entity set to "this" and Replace set to "true", and then you can add whatever lore you like. Once you're done, it goes in data > namespace > item_modifiers. To apply it to your item you'd run the command:
item modify entity @s <slot> <modifier_name>
Hope that helps!
i want to be able to change the lore based off of a specific variable. But the way this works would make it so i would need a seperate item modifier for every possible value.
Yea as mega7 said, you can include scores like you can in tellraw. Here's an example of what I think you're trying to do: https://pastebin.com/Fb8Nnv6y
Use a score value instead of a number. Using the item modifiers you can make it so it gets its value from a certain score.
And don't forget to put the right scale.
And don't forget to put the right scale.