-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8126d59
Showing
17 changed files
with
815 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Build data pack | ||
|
||
on: [push, workflow_dispatch] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install Poetry | ||
uses: snok/[email protected] | ||
with: | ||
virtualenvs-in-project: true | ||
|
||
- name: Setup cache | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install | ||
|
||
- name: Build data pack | ||
run: poetry run beet build | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: 'one-hundred-tiny-spiders' | ||
path: ${{ github.workspace }}/out/one-hundred-tiny-spiders/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
out/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Misode | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# One Hundred Tiny Spiders | ||
|
||
One hundred tiny spiders are spawned when you kill a normal spider. What could go wrong? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: One Hundred Tiny Spiders | ||
author: Misode | ||
version: 1.0.0 | ||
|
||
require: | ||
- bolt | ||
|
||
data_pack: | ||
name: "one-hundred-tiny-spiders" | ||
pack_format: 27 | ||
description: [ | ||
{ text: "{{project_name}}", color: "green" }, | ||
{ text: "\nv{{project_version}} by {{project_author}}.", color: "dark_gray" } | ||
] | ||
load: | ||
data: src | ||
|
||
pipeline: | ||
- mecha | ||
|
||
output: out |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[tool.poetry] | ||
name = "one-hundred-tiny-spiders" | ||
version = "0.1.0" | ||
description = "One hundred tiny spiders will spawn when killing a spider." | ||
authors = ["Misode <[email protected]>"] | ||
license = "MIT" | ||
readme = "README.md" | ||
homepage = "https://github.com/misode/one-hundred-tiny-spiders" | ||
repository = "https://github.com/misode/one-hundred-tiny-spiders" | ||
classifiers = [ | ||
"Private :: Do Not Publish" | ||
] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.11" | ||
|
||
[tool.poetry.dev-dependencies] | ||
black = { version = "^21.12b0", allow-prereleases = true } | ||
beet = "^0.100.0" | ||
bolt = "^0.44.0" | ||
mecha = "^0.85.2" | ||
|
||
[tool.beet] | ||
output = "build" | ||
extend = ["beet.yaml"] | ||
|
||
[[tool.beet.pipeline]] | ||
output = "build" | ||
extend = ["beet.yaml"] | ||
data_pack.zipped = true | ||
|
||
[build-system] | ||
requires = ["poetry-core>=1.0.0"] | ||
build-backend = "poetry.core.masonry.api" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
{ | ||
"type": "minecraft:entity", | ||
"pools": [ | ||
{ | ||
"rolls": 1, | ||
"bonus_rolls": 0, | ||
"entries": [ | ||
{ | ||
"type": "minecraft:item", | ||
"name": "minecraft:string", | ||
"functions": [ | ||
{ | ||
"function": "minecraft:set_count", | ||
"count": { | ||
"type": "minecraft:uniform", | ||
"min": 0, | ||
"max": 2 | ||
}, | ||
"add": false | ||
}, | ||
{ | ||
"function": "minecraft:looting_enchant", | ||
"count": { | ||
"type": "minecraft:uniform", | ||
"min": 0, | ||
"max": 1 | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"rolls": 1, | ||
"bonus_rolls": 0, | ||
"entries": [ | ||
{ | ||
"type": "minecraft:item", | ||
"name": "minecraft:spider_eye", | ||
"functions": [ | ||
{ | ||
"function": "minecraft:set_count", | ||
"count": { | ||
"type": "minecraft:uniform", | ||
"min": -1, | ||
"max": 1 | ||
}, | ||
"add": false | ||
}, | ||
{ | ||
"function": "minecraft:looting_enchant", | ||
"count": { | ||
"type": "minecraft:uniform", | ||
"min": 0, | ||
"max": 1 | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"conditions": [ | ||
{ | ||
"condition": "minecraft:killed_by_player" | ||
} | ||
] | ||
}, | ||
{ | ||
"rolls": 1, | ||
"entries": [ | ||
{ | ||
"type": "minecraft:item", | ||
"name": "minecraft:string", | ||
"functions": [ | ||
{ | ||
"function": "minecraft:set_nbt", | ||
"tag": "{one_hundred_tiny_spiders:1b}" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"random_sequence": "minecraft:entities/spider" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"values": [ | ||
"one_hundred_tiny_spiders:load" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"values": [ | ||
"one_hundred_tiny_spiders:tick" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
execute if entity @s[nbt={Item:{id:"minecraft:string",tag:{one_hundred_tiny_spiders:1b}}}] at @s run function one_hundred_tiny_spiders:spawn_tiny_spiders | ||
tag @s add one_hundred_tiny_spiders_tracked |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
scoreboard objectives add one_hundred_tiny_spiders dummy |
18 changes: 18 additions & 0 deletions
18
src/one_hundred_tiny_spiders/functions/spawn_tiny_spiders.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import random | ||
|
||
kill @e[type=item] | ||
|
||
for i in range(100): | ||
dx = round(random.uniform(-0.0001, 0.0001), 8) | ||
dy = round(random.uniform(0, 0.001), 8) | ||
dz = round(random.uniform(-0.0001, 0.0001), 8) | ||
|
||
scale = round(random.uniform(0.0625, 0.1), 8) | ||
|
||
summon spider ~ ~ ~ { \ | ||
Health:100f, \ | ||
Tags:[one_hundred_tiny_spiders], \ | ||
DeathLootTable:"minecraft:empty", \ | ||
Motion: [dx, dy, dz], | ||
Attributes:[{Name:"minecraft:generic.scale",Base:scale,Modifiers:[]}] \ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
execute as @e[type=item,tag=!one_hundred_tiny_spiders_tracked] run function one_hundred_tiny_spiders:check_item | ||
|
||
execute as @e[type=spider,tag=one_hundred_tiny_spiders] at @s run function one_hundred_tiny_spiders:tick_tiny_spider |
6 changes: 6 additions & 0 deletions
6
src/one_hundred_tiny_spiders/functions/tick_tiny_spider.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
scoreboard players add @s one_hundred_tiny_spiders 1 | ||
|
||
scoreboard players add @s[scores={one_hundred_tiny_spiders=100..140},predicate=one_hundred_tiny_spiders:stay_alive] one_hundred_tiny_spiders 1 | ||
|
||
execute if entity @s[scores={one_hundred_tiny_spiders=144},predicate=one_hundred_tiny_spiders:play_sound] run playsound minecraft:entity.chicken.egg master @a ~ ~ ~ 0.5 2 | ||
tp @s[scores={one_hundred_tiny_spiders=150..}] ~ ~-1000 ~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"condition": "minecraft:random_chance", | ||
"chance": 0.4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"condition": "minecraft:random_chance", | ||
"chance": 0.5 | ||
} |