> For the complete documentation index, see [llms.txt](https://renownedgames.gitbook.io/ai-tree/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://renownedgames.gitbook.io/ai-tree/api/runtime/decorator-node.md).

# Decorator Node

Type description and basic instructions.

### Description

Decorator Node is base abstract class for all decorator nodes.

To create a custom decorator node you should inherit from Decorator Node class and implement logic that is described below.

### OnUpdate

When inheriting from Decorator Node you have to override OnUpdate method.

<pre class="language-csharp"><code class="lang-csharp">public class ExampleDecoratorNode : DecoratorNode
{
    protected override State OnUpdate() 
    { 
        throw new System.NotImplementedException();
    }
<strong>}
</strong></code></pre>

* OnUpdate gets called every tick during node execution according to [Behaviour Tree](/ai-tree/basic/behaviour-tree.md)  Update Mode.
* OnUpdate returns state of the node after update.

### OnEnter and OnExit

You can also override OnEntry and OnExit methods.

<pre class="language-csharp" data-full-width="false"><code class="lang-csharp">public class ExampleDecoratorNode : DecoratorNode
{
    protected override void OnEntry()
    {
        base.OnEntry();
    }
 
    protected override State OnUpdate() 
    { 
        throw new System.NotImplementedException();
    }
    
    protected override void OnExit()
    {
        base.OnExit();
    }
<strong>}
</strong></code></pre>

* OnEntry gets called when [Behaviour Tree](/ai-tree/basic/behaviour-tree.md)  enters the node.
* OnExit gets called when [Behaviour Tree](/ai-tree/basic/behaviour-tree.md)  exits the node.

### FlowUpdate

You can also override FlowUpdate method.

{% code fullWidth="false" %}

```csharp
public class ExampleDecoratorNode : DecoratorNode
{
    protected override State OnUpdate()
    {
        throw new System.NotImplementedException();
    }

    protected override void FlowUpdate()
    {
        base.FlowUpdate();
    }
}
```

{% endcode %}

* FlowUpdate gets called every tick regardless of the node execution.

{% hint style="info" %}
To create custom decorator nodes in editor you should add [Node Content](/ai-tree/api/runtime/nodecontentattribute.md) attribute to your custom decorator node class.
{% endhint %}
