I am trying to write a custom API to move a character down to the bottom of the turn tracker, regardless of which position they are in. I get no errors, but when I run the api nothing happens. I am not using "normal' initiative for my 5e campaign. It is either the players turn or the enemies turn. Since I have 7 players, I wanted a way for them to click a button that posts a message in chat that they are taking their action, while simultaneously moving them to the bottom of the turn order. Since the player may not be at the top of the tracker (all players can act at any time), it is a little more challenging to control the array. This was my attempt to just push the Fiadh character to the end of the array regardless of what number in the array she was in: on('ready',function(){ "use strict"; on('chat:message',function(msg){ var turnorder; if('api' === msg.type && msg.content.match(/^!turn-fiadh/) ){ if(Campaign().get("turnorder") == "") turnorder = []; //Checking to make sure that the turnorder isn't empty. If it is, treat it like an empty array. else turnorder = JSON.parse(Campaign().get("turnorder")); turnorder.push(turnorder.splice(turnorder.indexOf("Fiadh"), 1)[0]); //Shift Fiadh to the end of the turn order no matter where she is at in the array. Campaign().set("turnorder", JSON.stringify(turnorder)); } }); });