Resource icon

Premium Custom Crop Growth System Template 1.0

Dependencies:
- PlaceholderAPI
- Javascript Expansion
- Math Expansion

javascript_placeholders.yml goes to plugins/PlaceholderAPI/
the rest except the eb file goes to the plugins/PlaceholderAPI/javascripts/ folder

i cant upload the js files so ill just paste the relevant stuff here
unix_now.js
JavaScript:
function main() {
    var x = Math.floor(new Date().getTime() / 1000)
    return x+""
} main()
unix_after5days.js
JavaScript:
function main() {
    var x = Math.floor(new Date().getTime() / 1000)
    var futureTime = x + 5 * 24 * 60 * 60; // Add 5 days in seconds
    return futureTime + "";
    
} main()
unix_format.js

JavaScript:
function main() {
    var unixTime = Math.floor(new Date().getTime() / 1000)
    var timeDifference = args[0] - unixTime
    if (args[1] == "d") {
        return Math.floor(timeDifference / (60 * 60 * 24))+"";
    } else if (args[1] == "h") {
        return Math.floor(timeDifference / 3600) % 24 +"";
    } else if (args[1] == "m") {
        return Math.floor(timeDifference / 60) % 60+"";
    } else if (args[1] == "s") {
        return timeDifference % 60+"";
    } else {
        return "NULL"
    }
} main()
Top