Zrips / CMI

117 stars 99 forks source link

PAPI Javascript extension does not work in scheduled commands #7539

Open FrancyMak opened 1 year ago

FrancyMak commented 1 year ago

Description of Issue

Hi, I created a script in javascript to take a random point on the map, in the form of coordinates. Every 4 hours (10 seconds per test) it should execute the command, but as you can see from the screen, the placeholder returns blank. I tested the command with cmi placeholder parse %javascript_lamaSpawn% and it works correctly.

Version Information

[12:12:07 INFO]: Versione di CMI: 9.3.0.6 BungeeCord CMIB  MySQL
[12:12:07 INFO]: CMILib: 1.2.4.1 
[12:12:07 INFO]: Server: Paper(307) 1.19.2-R0.1-SNAPSHOT

Errors

No response

Relevant Config Sections

function randomSpawnPoint(){
    var points = [
        {x: -95.5, y: 115, z: -76.5},
        {x: 1.5, y: 115, z: -131.5},
        {x: -9.5, y: 115, z: -208.5},
        {x: -93.5, y: 118, z: -119.5},
        {x: -165.5, y: 114, z: -95.5},
        {x: -344.5, y: 115, z: -119.5},
    ];
    return points[Math.floor(Math.random() * points.length)].x + "," + points[Math.floor(Math.random() * points.length)].y + "," + points[Math.floor(Math.random() * points.length)].z;
}
randomSpawnPoint()
LlamaPinata:
  Enabled: true
  Delay: 10
  Repeat: true
  Commands:
  - broadcast mm m spawn LlamaPinata 1 Spawn3,%javascript_lamaSpawn%

Relevant Plugins

PlaceholderAPI (2.11.3-DEV-160)

Agreements

Zrips commented 1 year ago

Need more information on this issue. What plugin are you using for your code? Have you tested your setup with different placeholders from different plugins?

FrancyMak commented 1 year ago

Need more information on this issue. What plugin are you using for your code? Have you tested your setup with different placeholders from different plugins?

The only two plugins are CMI and PlaceholderAPI with the extension to JavaScript.

If I do /broadcast (my placeholder) it comes back blank. However, if I do /cmi placeholder parse (my placeholder) it works correctly.

FrancyMak commented 1 year ago

Hi! Some news?