GnaspGames / Smelt

A CLI tool for Minecraft map makers
http://smelt.gnasp.com
MIT License
19 stars 4 forks source link

Provide plugins with more information #39

Closed JBartelsson closed 8 years ago

JBartelsson commented 8 years ago

I got my plugin with 3 CMD blocks that are created http://pastebin.com/9ruzMBZ8 Smelt should provide the plugin(here !resetentity) with information about the last command block. Example:

var resetentity = function(args,addCommand,addSetup,prevComm){

var Comm = args.join(" "); args.shift(); var Type = args[0]; args.shift(); args.shift(); args.shift(); args.shift(); var NBT = args[0]; if (prevComm.type==chain){ addCommand("/scoreboard players tag @e[type="+Type+"] add KILLENTITY "+ NBT,{"type":"impulse","auto":true}); } else {addCommand("/scoreboard players tag @e[type="+Type+"] add KILLENTITY "+ NBT,{"type":"chain","auto":true});} addCommand(Comm); addCommand("kill @e[tag=KILLENTITY]");

} module.exports=resetentity; So var prevComm has the fields type auto and conditional(and maybe direction for the future)

Or a function called for example:

setCommType

setCommType({"type":"chain","auto":true}); would do the same as typing in {"type":"chain","auto":true} in the .mcc file

thanks for reading

GnaspGames commented 8 years ago

Thanks for the suggestion. I've been thinking about this already, see #12 where I note I want plugins to be able to "Access previous commands already processed".

Could you repost your idea as a comment on that issue? I see this as the same idea, but I would like to remember your specific suggestion.

GnaspGames commented 8 years ago

I'm going to close this one. I've added a note on #12 that links to this. They are both the same issue.