跳到正文

Legendary Timed Spawner [Cobblemon]

作者:Quim201

This is a simple datapack that spawns a legendary on a timer, all legends included!

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

⭐ Legendary Timed Spawner ⭐

Legendary Timed Spawner is a datapack for Cobblemon that adds a chance for Legendary Pokémon to spawn around you while you’re exploring your world! The spawns are based on a timer and the biome you’re in, so different Pokémon can spawn depending on where you are.

The spawn list also includes Mythical Pokémon, Ultra Beasts and some regional forms. Pokémon can spawn in the Overworld, Nether and End!

Warning (⚠️) This datapack does not add Pokémon to your game! It only makes Pokémon that are already available in Cobblemon or your installed add-ons spawn. If a Pokémon or form isn’t available in your game, you’ll need an add-on that adds it.

🎲 How does it work? 🎲

  • Once the timer reaches its interval, the datapack rolls a chance for a Pokémon to spawn;
  • If the roll is successful, a random online player is chosen and the datapack checks the biome they’re in;
  • A Pokémon that matches that biome is then chosen and the datapack tries to spawn it near the player;
  • If there are no Pokémon configured for that biome, the spawn is skipped;
  • When a Pokémon spawns, a message will appear in chat with its name, the player it spawned near and the player’s biome.

By default, the timer is set to 60 minutes and there is a 2% chance of a Pokémon spawning each time the timer rolls. Pokémon spawn at level 70. Keep in mind that the timer rolling doesn’t mean a Pokémon will always spawn!

⚙️ Settings and commands ⚙️

The datapack is configurable meaning you can change some settings! Use /trigger lts_config to open the settings menu and click the buttons in chat:

  • You can change the chance of a Pokémon spawning each time the timer rolls;
  • You can change the time between rolls from 1 minute to 24 hours. Changing the time will reset the countdown;
  • You can pause the timer and resume it later;
  • You can reset the countdown to start it again;
  • You can use Force Spawn to try spawning a Pokémon immediately near a random online player. This skips the chance roll and doesn’t reset the timer.

You can also use these commands if you have permission to run functions:

  • You can use /function lts:force_roll to roll the configured chance immediately and reset the countdown;
  • You can use /function lts:force_spawn to try spawning a Pokémon immediately without rolling the chance.

Note: Players who can use the settings menu can change its settings and use the Force Spawn button. The settings apply to the whole world.

🌍 Biomes and spawning 🌍

The spawn list has 100 Pokémon entries, including Legendary Pokémon, Mythical Pokémon, Ultra Beasts and Galarian forms. Each Pokémon uses Cobblemon biome tags to determine where it can spawn.

The biome is checked at the selected player’s position. The Pokémon is placed nearby, so it may appear across a biome boundary. Some modded biomes can display as Unknown in the spawn announcement.

📦 Installation 📦

  1. Install Cobblemon for Minecraft Java 1.21.1.
  2. Place the datapack ZIP in your world’s datapacks folder.
  3. Enter the world and use /reload, or restart the world.
  4. Use /trigger lts_config to open the menu and adjust the settings.

📝 Change the Pokémon and Biomes 📝

Important Note: Modifying datapacks can be challenging for beginners. Make a backup before changing files! ⚠️

To customize the Pokémon, you’ll need to have the datapack folder unzipped and placed in your world’s datapacks folder. Use either the unzipped folder or the ZIP, not both. Once unzipped, navigate to the following location:

LegendaryTimedSpawner/data/lts/function/select_biome.mcfunction

Each Pokémon has a group of commands. For example, Articuno’s entry looks like this:

scoreboard players set #eligible lts_data 0
execute if biome ~ ~ ~ #lts:reference/is_glacial run scoreboard players set #eligible lts_data 1
execute if biome ~ ~ ~ #lts:reference/is_snowy_taiga run scoreboard players set #eligible lts_data 1
execute if biome ~ ~ ~ #lts:reference/is_snowy_forest run scoreboard players set #eligible lts_data 1
execute if score #eligible lts_data matches 1 run data modify storage lts:data pool append value {"id":"articuno","n":"Articuno"}

The first line starts the check for that Pokémon. Each execute if biome line adds a biome group where it can be selected. Only one of those biome groups needs to match. The last line adds the Pokémon to the list of possible spawns.

  • Remove a Pokémon: Delete its whole group, from the line that sets #eligible to 0 through the line containing its Pokémon name.
  • Remove a biome: Delete the corresponding execute if biome line from that Pokémon’s group. Keep at least one biome line if you want the Pokémon to be selectable.
  • Add a biome: Copy an existing execute if biome line into the Pokémon’s group, before its final line, and change the biome tag to an existing one.
  • Add a Pokémon: Copy a complete group, change its biome lines, then change both “id” and “n” in the final line. The ID must be a valid Cobblemon Pokémon specification; the name is what appears in chat.

For example, to add a Pokémon called Mew to the existing forest group, add these three lines as a separate group:

scoreboard players set #eligible lts_data 0
execute if biome ~ ~ ~ #lts:reference/is_forest run scoreboard players set #eligible lts_data 1
execute if score #eligible lts_data matches 1 run data modify storage lts:data pool append value {"id":"mew","n":"Mew"}

The available reference tags are in data/lts/tags/worldgen/biome/reference/. They refer to Cobblemon’s biome tags, which may include modded biomes. After making changes, save the file and use /reload. If a Pokémon does not appear, check the ID, the tag spelling and that its whole group is intact.

Note: This datapack checks the biome, but it does not currently apply time, weather, underground, underwater or individual weight conditions.

⏰ Change the Default Timer and Chance ⏰

You can change the active timer and chance in-game using /trigger lts_config. The interval can be adjusted from 1 minute to 24 hours, and the chance can be adjusted from 0% to 100%.

To change the defaults used when these settings have not yet been saved, open:

LegendaryTimedSpawner/data/lts/function/load.mcfunction

Find these lines:

execute unless score #interval lts_data matches 1200..1728000 run scoreboard players set #interval lts_data 72000
execute unless score #chance lts_data matches 0..1000 run scoreboard players set #chance lts_data 20

Change the last number of the interval line to the number of ticks you want. There are normally 1,200 ticks per minute, so 36,000 is 30 minutes and 72,000 is 60 minutes. The chance is stored in tenths of a percent: 20 is 2%, 50 is 5%, and 1000 is 100%.

These defaults do not overwrite valid settings already saved in a world. Use the in-game menu to change an existing world’s settings.

🎚️ Change the Pokémon Level 🎚️

To change the level of spawned Pokémon, open:

LegendaryTimedSpawner/data/lts/function/do_spawn.mcfunction

Find level=70 in the first line and replace 70 with the level you want, from 1 to 100. Save the file and use /reload.

💬 Change the Spawn Message 💬

The announcement is also in data/lts/function/do_spawn.mcfunction. Its text and colors are in the tellraw command on the second line. You can edit the text and color values, keeping the JSON punctuation intact.

Keep $(n) for the Pokémon’s name and $(biome) for the biome. The selector containing lts_target shows the selected player’s name. The first $ on each line is required for these function macros, so leave it in place. Save and use /reload after editing.

📍 Change the Spawn Distance 📍

To change how far away the datapack searches for a spawn position, open:

LegendaryTimedSpawner/data/lts/function/spawn_at_player.mcfunction

Find the two spreadplayers commands. In both commands, the 24 after ~ ~ 0 is the maximum search range. Change it in both lines to keep the Nether and other dimensions consistent. The Nether line also has under 128 to keep the search below the Nether roof. A suitable position may not always be found, especially on difficult terrain or near the End void.

Have some issues? You can join the Official Cobblemon discord server, search for ‘Legendary Timed Spawner’ and ask your questions there, or alternatively, you can DM me on discord.

常见问题

Legendary Timed Spawner [Cobblemon] 支持哪些 Minecraft 版本?

Legendary Timed Spawner [Cobblemon] 支持 Minecraft Java 版 1.21–1.21.1,共 2 个版本。下载时注意选择和你游戏版本一致的文件。

Legendary Timed Spawner [Cobblemon] 怎么安装?

新建世界时在「数据包」里把下载的 .zip 拖进去;已有的存档,把文件放进存档目录下的 datapacks 文件夹,进游戏输入 /reload 即可生效。服务器同样放在世界目录的 datapacks 里。

评论

登录后评论和评分

Quim201 的其他作品

查看全部 →