Skip to content

Commit

Permalink
fix: Milk automation advancement not triggering
Browse files Browse the repository at this point in the history
  • Loading branch information
Yarden-zamir committed Dec 16, 2024
1 parent 7577e5c commit 19eb07f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
7 changes: 7 additions & 0 deletions kubejs/server_scripts/base/features/milk.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Priority: 1

// addPurify('white_concrete_powder', 'milk', 15)
addPurify('white_concrete_powder', 'ptdye:flowing_milk', 15)
ServerEvents.tags("fluid", (event) => {event.add("ptdye:flowing_milk", ["minecraft:flowing_milk"]);});
Expand Down Expand Up @@ -40,6 +42,11 @@ function milk(event, currentTime) {
}
ItemEvents.entityInteracted("minecraft:bucket", (event) => {
if (!event.getTarget().getType() == "minecraft:cow") return
if (event.getTarget().getType() == "minecraft:cow") { // advancement trigger
if (event.player.persistentData.isEmpty()){ //this makes sure it's a deployer
Utils.server.runCommandSilent(`advancement grant ${event.player.name.string} only ptd:milk`)
}
}
let currentTime = event.getTarget().level.getTime();
event.player.swing();
if (!event.getTarget().persistentData.get("lastMilked")) {
Expand Down
8 changes: 0 additions & 8 deletions kubejs/server_scripts/base/features/milkAdvancementTrigger.js

This file was deleted.

0 comments on commit 19eb07f

Please sign in to comment.