Command Additions?
TeaCloudy opened this issue ยท 3 comments
Is it possible you could add a chat command that forces villagers too disable growth without disabling ai?
Potentionally in this case is it possible too implement reversed commands?
Arguably, since growing is a vanilla feature, this should be a separate mod adding this command universally.
@TeaCloudy since i've always wanted to have this option too, i found a workaround for this, after some trial and error. It's not perfect, but it's easy as it doesn't require mods.
It detects villager bed usage, particularly bed colors, and it triggers a set age to the villagers, essentially stopping them from aging)
Start the game, load into your world, then set the game to creative mode. Press the "esc" key, then click on open to lan, allow cheats on, start lan world. Then, type in the chat /gamemode creative.
Now, follow these steps:
1- type in chat /give "yourname" minecraft:command_block 2 or whatever amount you need.
2- place the two command blocks separate from each other
3- make sure the command blocks are set to "impulse" "unconditional" "needs redstone"
4- on the first block, type: "/execute as @e[type=mca:female_villager] at @s if block ~ ~0 ~ minecraft:pink_bed run data merge entity @s {Age:-7118701}" for the female villagers
5- one the second block, type: "/execute as @e[type=mca:male_villager] at @s if block ~ ~0 ~ minecraft:blue_bed run data merge entity @s {Age:-7118701}" for the male villagers
6- open chat and type: /gamemode survival and it's done.
Very important: you can turn "minecraft:blue_bed" and "minecraft:pink_bed" into whatever bed color you want. You can either have the same color of bed for both genders. If you wanna change the colors, just change "pink" or "blue" into whatever color you want. But for this to work, you first have to place the beds and assign the villagers to the beds, and connect both command blocks, to a redstone lever, button or pressure plate, for example. Then, you just press the lever button or walk on the pressure plate.
Alternatively, if you wanna make it automatic, without using any redstone, just make sure you set the command blocks to "repeating" "unconditional" "always active". But the villagers will raise a little bit on the bed and you wont be able to interact with them while they're asleep.
Another alternative if you want to make it automatic, is to create a redstone clock, just like shown in the screenshot. The villagers will continually move slightly up and down on the bed, but you will be able to interact with them while they're asleep.
(redstone clock setup: place the redstone repeaters and set everything, just like it's shown in the screenshot. then, place a redstone torch in one of the four redstone dust corners, and immediately break it, or the clock wont work.)
Also very important: for the different age groups, go to "{Age:-7118701}" and replace the "-7118701" with the respective ages numbers you want.
The age numbers are:
toddler: -7118701
child: -4426277
teen: -2165009
If you want to apply this to all three age groups, just add two more separate command blocks for each age group. but make sure each age group has different colored beds, or it won't work.
Then, connect all the command blocks to a single lever, button, pressure plate,
or set all the command blocks to "repeating" "unconditional" "always active" or set them all to "impulse" "unconditional" "needs redstone", depending on what type of setup you want, and connect them all to the redstone clock shown in the screenshot.
I would recommend using a pressure plate, lever or button. It's the most seamless solution. It can be placed in a doorway or location that that you use often.