Skip to content

Commit

Permalink
Add craftable item Boat Compass (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nincodedo authored Mar 20, 2023
1 parent 0471730 commit 17543e8
Show file tree
Hide file tree
Showing 12 changed files with 319 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"criteria": {
"requirement": {
"trigger": "minecraft:tick",
"conditions": {
"player": [
{
"condition": "minecraft:entity_scores",
"entity": "this",
"scores": {
"inboat": 1
}
},
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:alternative",
"terms": [
{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"vehicle": {
"type": "minecraft:boat"
}
}
},
{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"vehicle": {
"type": "minecraft:chest_boat"
}
}
}
]
}
},
{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"nbt": "{Inventory:[{id:\"minecraft:compass\",tag:{NinUnique:\"BoatCompass\"}}]}"
}
}
]
}
}
},
"rewards": {
"function": "nincodedo:items/boatcompass/mark_boat_location"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"criteria": {
"requirement": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "nincodedo:boat_compass"
}
}
},
"rewards": {
"function": "nincodedo:recipes/give_boat_compass"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
item modify entity @s[nbt={Inventory:[{Slot:0b,tag:{NinUnique:"BoatCompass"}}]}] hotbar.0 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:1b,tag:{NinUnique:"BoatCompass"}}]}] hotbar.1 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:2b,tag:{NinUnique:"BoatCompass"}}]}] hotbar.2 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:3b,tag:{NinUnique:"BoatCompass"}}]}] hotbar.3 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:4b,tag:{NinUnique:"BoatCompass"}}]}] hotbar.4 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:5b,tag:{NinUnique:"BoatCompass"}}]}] hotbar.5 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:6b,tag:{NinUnique:"BoatCompass"}}]}] hotbar.6 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:7b,tag:{NinUnique:"BoatCompass"}}]}] hotbar.7 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:8b,tag:{NinUnique:"BoatCompass"}}]}] hotbar.8 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:9b,tag:{NinUnique:"BoatCompass"}}]}] inventory.0 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:10b,tag:{NinUnique:"BoatCompass"}}]}] inventory.1 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:11b,tag:{NinUnique:"BoatCompass"}}]}] inventory.2 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:12b,tag:{NinUnique:"BoatCompass"}}]}] inventory.3 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:13b,tag:{NinUnique:"BoatCompass"}}]}] inventory.4 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:14b,tag:{NinUnique:"BoatCompass"}}]}] inventory.5 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:15b,tag:{NinUnique:"BoatCompass"}}]}] inventory.6 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:16b,tag:{NinUnique:"BoatCompass"}}]}] inventory.7 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:17b,tag:{NinUnique:"BoatCompass"}}]}] inventory.8 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:18b,tag:{NinUnique:"BoatCompass"}}]}] inventory.9 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:19b,tag:{NinUnique:"BoatCompass"}}]}] inventory.10 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:20b,tag:{NinUnique:"BoatCompass"}}]}] inventory.11 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:21b,tag:{NinUnique:"BoatCompass"}}]}] inventory.12 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:22b,tag:{NinUnique:"BoatCompass"}}]}] inventory.13 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:23b,tag:{NinUnique:"BoatCompass"}}]}] inventory.14 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:24b,tag:{NinUnique:"BoatCompass"}}]}] inventory.15 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:25b,tag:{NinUnique:"BoatCompass"}}]}] inventory.16 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:26b,tag:{NinUnique:"BoatCompass"}}]}] inventory.17 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:27b,tag:{NinUnique:"BoatCompass"}}]}] inventory.18 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:28b,tag:{NinUnique:"BoatCompass"}}]}] inventory.19 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:29b,tag:{NinUnique:"BoatCompass"}}]}] inventory.20 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:30b,tag:{NinUnique:"BoatCompass"}}]}] inventory.21 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:31b,tag:{NinUnique:"BoatCompass"}}]}] inventory.22 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:32b,tag:{NinUnique:"BoatCompass"}}]}] inventory.23 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:33b,tag:{NinUnique:"BoatCompass"}}]}] inventory.24 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:34b,tag:{NinUnique:"BoatCompass"}}]}] inventory.25 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:35b,tag:{NinUnique:"BoatCompass"}}]}] inventory.26 nincodedo:set_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:-106b,tag:{NinUnique:"BoatCompass"}}]}] weapon.offhand nincodedo:set_boat_compass

advancement revoke @s only nincodedo:items/get_out_of_boat
playsound minecraft:item.lodestone_compass.lock block @s ~ ~ ~ 1
scoreboard players set @s inboat 2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scoreboard objectives add inboat dummy
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
function nincodedo:uniqueitems/load
function nincodedo:items/load

scoreboard objectives add advrewards dummy
scoreboard objectives add bannerplz trigger
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
clear @s minecraft:knowledge_book
give @s minecraft:compass{NinUnique:"BoatCompass"}
recipe take @s nincodedo:boat_compass
advancement revoke @s only nincodedo:recipes/boat_compass

item modify entity @s[nbt={Inventory:[{Slot:0b,tag:{NinUnique:"BoatCompass"}}]}] hotbar.0 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:1b,tag:{NinUnique:"BoatCompass"}}]}] hotbar.1 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:2b,tag:{NinUnique:"BoatCompass"}}]}] hotbar.2 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:3b,tag:{NinUnique:"BoatCompass"}}]}] hotbar.3 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:4b,tag:{NinUnique:"BoatCompass"}}]}] hotbar.4 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:5b,tag:{NinUnique:"BoatCompass"}}]}] hotbar.5 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:6b,tag:{NinUnique:"BoatCompass"}}]}] hotbar.6 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:7b,tag:{NinUnique:"BoatCompass"}}]}] hotbar.7 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:8b,tag:{NinUnique:"BoatCompass"}}]}] hotbar.8 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:9b,tag:{NinUnique:"BoatCompass"}}]}] inventory.0 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:10b,tag:{NinUnique:"BoatCompass"}}]}] inventory.1 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:11b,tag:{NinUnique:"BoatCompass"}}]}] inventory.2 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:12b,tag:{NinUnique:"BoatCompass"}}]}] inventory.3 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:13b,tag:{NinUnique:"BoatCompass"}}]}] inventory.4 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:14b,tag:{NinUnique:"BoatCompass"}}]}] inventory.5 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:15b,tag:{NinUnique:"BoatCompass"}}]}] inventory.6 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:16b,tag:{NinUnique:"BoatCompass"}}]}] inventory.7 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:17b,tag:{NinUnique:"BoatCompass"}}]}] inventory.8 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:18b,tag:{NinUnique:"BoatCompass"}}]}] inventory.9 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:19b,tag:{NinUnique:"BoatCompass"}}]}] inventory.10 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:20b,tag:{NinUnique:"BoatCompass"}}]}] inventory.11 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:21b,tag:{NinUnique:"BoatCompass"}}]}] inventory.12 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:22b,tag:{NinUnique:"BoatCompass"}}]}] inventory.13 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:23b,tag:{NinUnique:"BoatCompass"}}]}] inventory.14 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:24b,tag:{NinUnique:"BoatCompass"}}]}] inventory.15 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:25b,tag:{NinUnique:"BoatCompass"}}]}] inventory.16 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:26b,tag:{NinUnique:"BoatCompass"}}]}] inventory.17 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:27b,tag:{NinUnique:"BoatCompass"}}]}] inventory.18 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:28b,tag:{NinUnique:"BoatCompass"}}]}] inventory.19 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:29b,tag:{NinUnique:"BoatCompass"}}]}] inventory.20 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:30b,tag:{NinUnique:"BoatCompass"}}]}] inventory.21 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:31b,tag:{NinUnique:"BoatCompass"}}]}] inventory.22 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:32b,tag:{NinUnique:"BoatCompass"}}]}] inventory.23 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:33b,tag:{NinUnique:"BoatCompass"}}]}] inventory.24 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:34b,tag:{NinUnique:"BoatCompass"}}]}] inventory.25 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:35b,tag:{NinUnique:"BoatCompass"}}]}] inventory.26 nincodedo:remove_boat_compass
item modify entity @s[nbt={Inventory:[{Slot:-106b,tag:{NinUnique:"BoatCompass"}}]}] weapon.offhand nincodedo:remove_boat_compass
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
execute store result score current_day rhcdata run time query day
execute store result score player_count rhcdata run list

execute as @e[type=minecraft:pillager,name=!"Salesman",limit=1] run data merge entity @s {CustomName: '{"text":"Salesman"}', CustomNameVisible: 1, KillMessage: '%s sold some wares to %s'}
data merge entity @e[type=minecraft:pillager,name=!"Salesman",limit=1] {CustomName: '{"text":"Salesman"}', CustomNameVisible: 1, KillMessage: '%s sold some wares to %s'}

execute as @e[type=minecraft:wandering_trader,limit=1,tag=!traderswap] run function nincodedo:quests/tradermap

scoreboard players set @a[predicate=nincodedo:isplayerinboat] inboat 1
scoreboard players set @a[predicate=!nincodedo:isplayerinboat] inboat 0

schedule function nincodedo:slowtick 2s
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[
{
"function": "minecraft:set_nbt",
"tag": "{NinUnique:\"BoatCompass\"}"
},
{
"function": "minecraft:set_name",
"entity": "this",
"name": {
"text": "Your Boat Compass",
"italic": false
}
},
{
"function": "minecraft:set_lore",
"entity": "this",
"lore": [
{
"text": "Keeps track of your boat's",
"color": "gray"
},
{
"text": "location when you get out.",
"color": "gray"
}
],
"replace": true
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
[
{
"function": "minecraft:copy_nbt",
"source": "this",
"ops": [
{
"source": "Pos[0]",
"target": "LodestonePos.X",
"op": "replace"
},
{
"source": "Pos[1]",
"target": "LodestonePos.Y",
"op": "replace"
},
{
"source": "Pos[2]",
"target": "LodestonePos.Z",
"op": "replace"
}
]
},
{
"function": "minecraft:set_nbt",
"tag": "{LodestoneTracked:0b}"
},
{
"function": "minecraft:set_nbt",
"tag": "{LodestoneDimension:\"minecraft:overworld\"}",
"conditions": [
{
"condition": "minecraft:location_check",
"predicate": {
"dimension": "minecraft:overworld"
}
}
]
},
{
"function": "minecraft:set_nbt",
"tag": "{LodestoneDimension:\"minecraft:the_nether\"}",
"conditions": [
{
"condition": "minecraft:location_check",
"predicate": {
"dimension": "minecraft:the_nether"
}
}
]
},
{
"function": "minecraft:set_nbt",
"tag": "{LodestoneDimension:\"minecraft:the_end\"}",
"conditions": [
{
"condition": "minecraft:location_check",
"predicate": {
"dimension": "minecraft:the_end"
}
}
]
},
{
"function": "minecraft:set_name",
"entity": "this",
"name": {
"text": "Your Boat Compass",
"italic": false
}
},
{
"function": "minecraft:set_lore",
"entity": "this",
"lore": [
{
"text": "Keeps track of your boat's",
"color": "gray"
},
{
"text": "location when you get out.",
"color": "gray"
}
],
"replace": true
}
]
Loading

0 comments on commit 17543e8

Please sign in to comment.