This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
Hi there,
I don't think that this is currently possible with MyCommand, and this would be a very helpful feature for all math-related script actions.
I am currently trying to create a script for a command that converts a player's exp into experience bottles.
The problem that occurs here: the original exp value is an integer, but gets divided by 7 into a double. I would like for it to stay an integer.
For example: 55/7 results in 7.85...
I would like it to result in either 7 (integer behaviour), or rounded up to 8.
Most commands (like /give, or the built-in addItem API option) don't accept doubles and will make the whole script fail.
- '$RUN_CONSOLE$/mycmd-playerdata set_silent $player MaxBottles $exp' - '$Script$%PlayerData%MaxBottles/7'
...
- '%PlayerOptions%addItem: EXPERIENCE_BOTTLE:$PlayerData%MaxBottles%'
I would like to suggest a feature that makes it possible to keep an integer value, or transform a double into one.
please use placeholderapi-math expansion
Thank you, this solution works.
To post a comment, please login or register a new account.