ps-dps / MobCaptains

Rare and strong mobs, dropping illegally enchanted gear
https://modrinth.com/datapack/mob-captains
MIT License
5 stars 0 forks source link

Commands for testing #5

Closed chaka996 closed 1 year ago

chaka996 commented 1 year ago

Would be really nice to have commands for testing mob captains to make sure they are interacting with other mods properly and for testing loot tables.

PuckiSilver commented 1 year ago

To test stuff out, you can call function ps-mob:convert/<RARITY> as any mob. So to convert the nearest mob that can become a captain to a legendary captain, run the following command while next to it:

execute as @e[type=#ps-mob:captains,limit=1,sort=nearest] run function ps-mob:convert/legendary

If you only want to test out the loot tables you can just give yourself the loot with one of the following commands:

loot give @s loot ps-mob:base/<RARITY>
loot give @s loot ps-mob:captain/<RARITY>

Make sure to replace <RARITY> with one of the rarities The base loot tables are only items of that rarity but as captains can (with a lower probability) drop items of other rarities, the captain loot tables are what the captains of that rarity will actually drop

allanonmage commented 1 year ago

I turned myself into a legendary mob while fooling around with the commands. I tried the same command to common (and others), and I still have all the extra buffs. How can I remove the extra buffs?

I mean, it's not like I don't want to keep them, but I might have to give the same buffs to the other people on my server and they already think things are pretty complicated lololol

PuckiSilver commented 1 year ago

Hey, to undo that, you can run the following commands one-by-one

/attribute @s generic.max_health modifier remove 15213119-2-2-2-2
/attribute @s generic.armor modifier remove 15213119-2-2-2-2
/attribute @s generic.movement_speed modifier remove 15213119-2-2-2-2
/attribute @s generic.attack_damage modifier remove 15213119-2-2-2-2
/attribute @s generic.knockback_resistance modifier remove 15213119-2-2-2-2
/tag @s remove smithed.entity
/tag @s remove ps-mob
/tag @s remove ps-mob.captain
/tag @s remove ps-mob.legendary
/tag @s remove ps-mob.rare
/tag @s remove ps-mob.uncommon
/tag @s remove ps-mob.common
allanonmage commented 1 year ago

Thanks, that worked! If I want to add those to a player, instead of @s, I would use @theirName and change remove to add?

PuckiSilver commented 1 year ago

No, that's a little more complicated - if you would want to give these attributes to a player you can look at the functions at /data/ps-mob/functions/convert/<rarity> and /data/ps-mob/functions/convert/captain

The convert/captain function gets run for captains of any difficulty and the convert/<rarity> functions only get run for a mob captain of that rarity

The convert/<rarity> functions apply the attribute modifiers