We've split up the commands, scripting and mods, and add ons category! Please be sure you get your thread in the right place.

13

Trigonometry functions

2 Comments

Please sign in to leave a comment.

Sorted by oldest
  • 4
    Registered User commented
    Comment actions Permalink

    I suggest this command:

    /math <operation>

    Where the output can be gotten through /execute store result...

    <operation> would be used like this:

    <operation_name operands...> OR <operand operation operand>

    and operand could be:

    any number literal (double) OR entity <selector> <path> OR storage <path> OR run <chained command>

    Any number is converted to a double before operation. Chained run commands must come last, and their result value is used. 

    Here is an example for trig:

    /math sin entity @s Rotation[0]

    or, alternatively:

    /math 3 + 3

    If you wanted to store the value to a scoreboard, you could do:

    /execute store result score #myScore myObjective run math 3 + 3

    It would be much better if Minecraft would just implement a scripting language like JavaScript or Python. I know that JavaScript has ways to sandbox it so it can't access the user's filesystem, network or spawn new processes, and it could be set up to interact with a Minecraft-specific API only. Since JS is a scripting language, datapacks could be added and removed at runtime without restarting the game (unlike Java mods). JS already has built-in objects like Math that allow for calculations like this. This would be much better than re-inventing the wheel one piece at a time through a command system.

     

  • 0
    Registered User commented
    Comment actions Permalink

    Splox Fox

    Great idea; you might want to make that its own post.