A feedback area designed for scripting and mods suggestions and feedback. Please note bug reports and support issues will be removed.

249

New data for datapack : Command (Custom Commands)

13 Comments

Please sign in to leave a comment.

Sorted by oldest
  • 7
    Registered User commented
    Comment actions Permalink

    I like that you can decide if non-OP player can use that command or not.

  • 15
    Registered User commented
    Comment actions Permalink

    Even better than "op" requirement: allow the command to set the "operator level", the 1-4 scale.

  • 4
    Registered User commented
    Comment actions Permalink

    What would also suit this change is:

    • Scoped variables (allows function/command recursion) instead of global scoreboard
    • String variables (allows string arguments in commands)

     

  • 1
    Registered User commented
    Comment actions Permalink
    It's possible ? To do that  ?
  • 3
    Registered User commented
    Comment actions Permalink

    Well, I have an example for getting a local player name:

    `{
    "getlocalplayername": {
    "versions": [
    {
    "description": "commands.getlocalplayername.description",
    "permission": "any",
    "is_hidden": true,

    "overloads": {
    "default": {
    "input": {
    "parameters": []
    },
    "output": {
    "format_strings": [
    {
    "format": "{0}"
    }
    ],
    "parameters": [
    {
    "name": "localplayername",
    "type": "string"
    }
    ]
    }
    }
    }
    }
    ]
    }
    }`
    As you can see here, "format_strings" can be used in text formatting, set the message color and conditions for the message to display. The "permissions" object is more suitable for this. "is_hidden" is included.

  • 0
    Registered User commented
    Comment actions Permalink

    This is great idea

  • 3
    Registered User commented
    Comment actions Permalink

    I'd love for your idea to be realized, because I realized that running functions can't be compared to commands like gamemode or scoreboard. But actually, I'd want them be like that. In several projects now I simply don't need a looped function and who wouldn't prefer that if it's possible, right? But then always running /function project:blabla and quickly finding the one, within sometimes a couple 50, is a bit annoying for the purpose.

    This is my first time commenting on feedback, is there way to keep up in case something happens considering this topic? I'd love to know where this goes

    Edit: For this purpose tho it might be enough, if you could simply create an alias for a certain function. Still like the idea tho!

  • 1
    Registered User commented
    Comment actions Permalink

    Tim Herten
    Thanks for your answer! You can follow the suggestion by clicking on the button at the top of the topic ;)

  • 2
    Registered User commented
    Comment actions Permalink

    :| I don't understand a word of that... But I like what I heard.

  • 2
    Registered User commented
    Comment actions Permalink

    I agree, Brigadier can do it easly for us in modding why not in datapacks ?

    Edit : It will be sooo much cool to have the possibility to have int and strings arguments in the command and re-use this variables into our mcfunction file !

  • 1
    Registered User commented
    Comment actions Permalink

    is there a way to be done in java datapack?

  • 0
    Registered User commented
    Comment actions Permalink

    This is a really cool idea and I hope that mojang listens

  • 0
    Registered User commented
    Comment actions Permalink

    This is good idea - I think it could potentially be a replacement/upgrade to the /trigger command. 

    A couple things to add onto it:

    • Like /trigger, can we choose to enable it instead of being required only by OP? Replace the 'only_op' with 'type', which accepts 'requires_op' or 'enabling', and have a /command <selector> enable <command_path>, for example.
    • Instead of utilizing scoreboards, we should target some data component, like storage.

    For example, your second sample command could have 'storage' next to 'only_op', which takes in a resource location 'test:example command.cookie' where your values would be inserted when run

    If you were to run

    • /cookie 1 entity zombie then under 'test:example command.cookie' you would get {number:1,entity:"zombie"}
    • /cookie 3 block 12 13 14 then under 'test:example command.cookie' you would get {number:3,block:[12, 13, 14]}

    This leads me to think you could generalize the required inputs. For example, a 'selector' type could instead return a list of UUID's.

    Of course, this idea is so versatile that there's A LOT that can be added. But the idea itself is really awesome. Good luck!