Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Stonley890 committed Jun 4, 2022
0 parents commit d2765b8
Show file tree
Hide file tree
Showing 20 changed files with 125 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.DS_Store
Binary file added data/.DS_Store
Binary file not shown.
Binary file added data/manhunt/.DS_Store
Binary file not shown.
Binary file added data/manhunt/functions/.DS_Store
Binary file not shown.
14 changes: 14 additions & 0 deletions data/manhunt/functions/load-core.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Initialize
team add Runner
team modify Runner color red
team modify Runner seeFriendlyInvisibles true
team add Hunter
team modify Hunter color blue
team modify Hunter seeFriendlyInvisibles true
setblock 0 -64 0 yellow_shulker_box

# Loop
schedule function manhunt:loop-core 1

# Hello World
function manhunt:load/hw
Binary file added data/manhunt/functions/load/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions data/manhunt/functions/load/hw.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tellraw @a ["\n",{"text":"Manhunt loaded!","bold":true,"color":"aqua"},"\n",{"text":"Version 1.0","color":"gold"},"\n","\n",{"text":"Use /trigger manhunt:start to get started.","color":"gray"},"\n",{"text":"Put all runners on the runner team","italic":true,"color":"dark_gray"},"\n"]
4 changes: 4 additions & 0 deletions data/manhunt/functions/loop-core.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
execute as @a[team=Hunter] if entity @s[nbt={SelectedItem:{id: "minecraft:compass", Count: 1b, tag: {display: {Name: '{"text":"Tracker Compass","color": "aqua","italic": false}'}}}}] run loot replace entity @s weapon mine 0 -64 0 air{drop_contents: 1b}
execute as @a[team=Hunter] if entity @s[nbt={SelectedItem:{id: "minecraft:compass", Count: 1b, tag: {display: {Name: '{"text":"Tracker Compass","color": "aqua","italic": false}'}}}}] run title @s actionbar {"text":"Compass Refreshed","color":"green"}

schedule function manhunt:loop-core 1
Binary file added data/manhunt/functions/loop/.DS_Store
Binary file not shown.
14 changes: 14 additions & 0 deletions data/manhunt/functions/loop/locate.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Set dimension
execute as @a[nbt={SelectedItem:{id: "minecraft:compass", Count: 1b, tag: {display: {Name: '{"text":"Tracker Compass","color": "aqua","italic": false}'}}}}] at @s in minecraft:overworld if entity @a[team=Runner,distance=0..] run data modify storage manhunt:test Item set value {id: "minecraft:compass", tag: {display: {Name: '{"text":"Tracker Compass","color": "aqua","italic": false}'}, LodestoneTracked: 0b, LodestoneDimension:"minecraft:overworld", LodestonePos: {X:0,Y:0,Z:0}}, Count: 1b}
execute as @a[nbt={SelectedItem:{id: "minecraft:compass", Count: 1b, tag: {display: {Name: '{"text":"Tracker Compass","color": "aqua","italic": false}'}}}}] at @s in minecraft:the_end if entity @a[team=Runner,distance=0..] run data modify storage manhunt:test Item set value {id: "minecraft:compass", tag: {display: {Name: '{"text":"Tracker Compass","color": "aqua","italic": false}'}, LodestoneTracked: 0b, LodestoneDimension:"minecraft:the_end", LodestonePos: {X:0,Y:0,Z:0}}, Count: 1b}
execute as @a[nbt={SelectedItem:{id: "minecraft:compass", Count: 1b, tag: {display: {Name: '{"text":"Tracker Compass","color": "aqua","italic": false}'}}}}] at @s in minecraft:the_nether if entity @a[team=Runner,distance=0..] run data modify storage manhunt:test Item set value {id: "minecraft:compass", tag: {display: {Name: '{"text":"Tracker Compass","color": "aqua","italic": false}'}, LodestoneTracked: 0b, LodestoneDimension:"minecraft:the_nether", LodestonePos: {X:0,Y:0,Z:0}}, Count: 1b}

# Get loc
execute as @a[nbt={SelectedItem:{id: "minecraft:compass", Count: 1b, tag: {display: {Name: '{"text":"Tracker Compass","color": "aqua","italic": false}'}}}}] at @s store result storage manhunt:test Item.tag.LodestonePos.X int 1 run data get entity @a[team=Runner,limit=1,sort=nearest] Pos[0]
execute as @a[nbt={SelectedItem:{id: "minecraft:compass", Count: 1b, tag: {display: {Name: '{"text":"Tracker Compass","color": "aqua","italic": false}'}}}}] at @s store result storage manhunt:test Item.tag.LodestonePos.Y int 1 run data get entity @a[team=Runner,limit=1,sort=nearest] Pos[1]
execute as @a[nbt={SelectedItem:{id: "minecraft:compass", Count: 1b, tag: {display: {Name: '{"text":"Tracker Compass","color": "aqua","italic": false}'}}}}] at @s store result storage manhunt:test Item.tag.LodestonePos.Z int 1 run data get entity @a[team=Runner,limit=1,sort=nearest] Pos[2]

data modify block 0 -64 0 Items append from storage manhunt:test Item

# Loop
schedule function manhunt:loop/locate 10
6 changes: 6 additions & 0 deletions data/manhunt/functions/start.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Give compasses to hunters
team join Hunter @a[team=!Runner]
give @a[team=Hunter] compass{display:{Name:'{"text":"Tracker Compass","color": "aqua","italic": false}'}}
tellraw @a[team=Hunter] {"text":"Your compass will update when held. It will point toward the nearest player.","color":"aqua"}

schedule function manhunt:loop/locate 10
5 changes: 5 additions & 0 deletions data/manhunt/functions/uninstall.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
team remove Hunter
team remove Runner
setblock 0 -64 0 bedrock
datapack disable "file/Compass Tracker.zip"
datapack disable "file/Compass Tracker"
Binary file added data/manhunt/tags/.DS_Store
Binary file not shown.
Binary file added data/minecraft/.DS_Store
Binary file not shown.
69 changes: 69 additions & 0 deletions data/minecraft/loot_tables/blocks/yellow_shulker_box.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:alternatives",
"children": [
{
"type": "minecraft:dynamic",
"name": "minecraft:contents",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"items": ["minecraft:air"],
"nbt": "{drop_contents:1b}"
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:yellow_shulker_box",
"functions": [
{
"function": "minecraft:copy_name",
"source": "block_entity"
},
{
"function": "minecraft:copy_nbt",
"source": "block_entity",
"ops": [
{
"source": "Lock",
"target": "BlockEntityTag.Lock",
"op": "replace"
},
{
"source": "LootTable",
"target": "BlockEntityTag.LootTable",
"op": "replace"
},
{
"source": "LootTableSeed",
"target": "BlockEntityTag.LootTableSeed",
"op": "replace"
}
]
},
{
"function": "minecraft:set_contents",
"type": "minecraft:shulker_box",
"entries": [
{
"type": "minecraft:dynamic",
"name": "minecraft:contents"
}
]
}
]
}
]
}
]
}
]
}
Binary file added data/minecraft/tags/.DS_Store
Binary file not shown.
Binary file added data/minecraft/tags/functions/.DS_Store
Binary file not shown.
5 changes: 5 additions & 0 deletions data/minecraft/tags/functions/load.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"manhunt:load-core"
]
}
6 changes: 6 additions & 0 deletions pack.mcmeta
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"pack": {
"pack_format": 7,
"description": "Track runners in any dimension"
}
}
Binary file added pack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d2765b8

Please sign in to comment.