Decorator Nodes - Lyinginbedmon/TricksyFoxes GitHub Wiki

Decorator nodes always have a single child node and either alter their own result based on the result of the child or alter the behaviour of the child node in some fashion.

  • Delay

Inputs: The number of seconds to delay (default: 1)

A delay node will wait a certain number of seconds before executing the child node as normal. This is useful if the mob needs to wait for a period inbetween actions, such as to wait for a furnace to smelt something or to flip a lever to close a sluggish redstone door after opening it.

  • Do Once

This decorator will only trigger its child node once each time the mob is loaded into the world. This is particularly useful for initialising logic and other details before the mob gets the rest of its behaviour underway.

  • Force Failure

The only end state this node will only ever return is failure, regardless the actual state returned by its child node. An example of usage would be to ensure a selector runs a momentary action (such as cycling a list value or setting an attack target) without ending the present tick.

  • Force Success

Similar to the Always Failure decorator, this node will only return success, excepting their child node is running. This can be useful if you want a sequence to continue regardless of whether or not an action was successful.

  • For Each

Inputs: Any list of values

This decorator functions similarly to Repeat, except that it will run once for each value in the input list and will cycle the next to the top each time the child returns success. This is particularly useful for open-ended behaviours like mining all the blocks within a region.

  • Inverter

This decorator always returns the opposite value of the child node, either success when it fails or failure when it succeeds. If the child node returns that it is still running, the inverter does as well. This is particularly useful to reverse the output of a condition, allowing the mob to react when a condition isn't met.

  • Repeat

Inputs: The number of times to repeat (default: 4)

This decorator will return running until its child node has been run a certain number of times or returns failure. An example usage might be to drain up to N items from a container at a time.

  • Retry

Inputs: The number of times to retry (default: 4)

Similar to Repeat, this node will repeatedly run its child node until either a certain number of attempts have been made or it returns success.

  • Wait For Cooldown

This decorator will only fire if its child node (and all of its child nodes, if any) are not currently on cooldown, otherwise it will return running.