Skip to content

CommandNodeAccessor ​

com.jsmacrosce.jsmacros.client.access.CommandNodeAccessor

Reflectively removes direct children from Brigadier command nodes.
This accessor depends on reflective access to the node's child maps, which is not guaranteed to be available on every version.

js
const CommandNodes = Java.type("com.jsmacrosce.jsmacros.client.access.CommandNodeAccessor");  
function removeChild(parent, name) {
  return CommandNodes.remove(parent, name);  
}

Constructors ​

new CommandNodeAccessor ​

new CommandNodeAccessor()#

Methods ​

remove ​

static remove(CommandNode<S> parent, String name): CommandNode<S>#
Removes a direct child by its key from the parent's child map and, for literal or argument nodes, the corresponding subtype map. Removal is not recursive; failure accessing a subtype map can occur after the child has already been removed from the child map.

Parameters:

  • parent: node whose direct-child maps are modified
  • name: key of the child to remove

Type Parameters:

  • S: command-source type of the nodes
Returns: removed child, or null if no child has that key