Skip to content

Commit

Permalink
fix: counterfeit milk from any none cow entity
Browse files Browse the repository at this point in the history
  • Loading branch information
Yarden-zamir committed Dec 31, 2024
1 parent 96dd0f0 commit a0e4eec
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions kubejs/server_scripts/base/features/milk.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,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`)
}
if (event.getTarget().getType() != "minecraft:cow") return

// 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();
Expand Down

0 comments on commit a0e4eec

Please sign in to comment.