NullReferenceException at EntityDestroyedFixed
(09:41:30) | Failed to call hook 'OnEntityDeath' on plugin 'EntityLimit v0.6.3' (NullReferenceException: Object reference not set to an instance of an object) at Oxide.Plugins.EntityLimit.EntityDestroyed (BaseEntity entity) [0x0005b] in <9e8ad50bfd5044c7ac210b9c822e1e6c>:0 at Oxide.Plugins.EntityLimit.OnEntityDeath (BaseCombatEntity entity, HitInfo hitInfo) [0x0000d] in <9e8ad50bfd5044c7ac210b9c822e1e6c>:0 at Oxide.Plugins.EntityLimit.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00221] in <9e8ad50bfd5044c7ac210b9c822e1e6c>:0 at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <9affce1cd15c4ec183941adef8db1722>:0 at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <4452f821def6406d834e4149849fe7ea>:0 at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <4452f821def6406d834e4149849fe7ea>:0

Merged post

I get that message everytime i keep placing an item that says it has reached the limit but im still allowed to keep placing them.
What's the name of the item ?
it was those that had .deployed, so chair.deployed, table.deployed, mailbox.deployed but i think by adding the line i added from the other thread post worked bc i don't see the error anymore, but not totally sure if that's what fixed it.

if (entity.ShortPrefabName == "mailbox.deployed") 
item = ItemManager.CreateByName("mailbox");

if (entity.ShortPrefabName == "table.deployed") 
item = ItemManager.CreateByName("table");

and so on.

i did this for all of the items that end with .deployed.

Merged post

I'm still seeing that error, but it is limiting the items i put, not sure why that errors keep spamming in console, ill keep looking into it.
void EntityDestroyed(BaseEntity entity)
        {
            if (entity == null) return;

            if (Cfg.MaxLimits.Any(x => x.Key == entity.ShortPrefabName))
            {
                PlayerLimit info = data?.Limits?.Find(x => x.Id == entity.OwnerID) ?? null;
                Entities PlayerEnts = info?.limit?.Find(x => x.Name == entity.ShortPrefabName) ?? null;

                if (info == null || PlayerEnts == null) return;
				if (PlayerEnts.Count == 0) return;

                PlayerEnts.Count -= 1;
            }
        }


line 179 (EntityDestroyed), maybe will help

Tyvm Orange, that seems to fixed the issue.
I 'think' I only started seeing this after the recent patch.

(07:31:37) | Failed to call hook 'OnEntityDeath' on plugin 'EntityLimit v0.6.3' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.EntityLimit.EntityDestroyed (BaseEntity entity) [0x0005b] in <a71865497250490fb63509ee4c185af5>:0 
  at Oxide.Plugins.EntityLimit.OnEntityDeath (BaseCombatEntity entity, HitInfo hitInfo) [0x0000d] in <a71865497250490fb63509ee4c185af5>:0 
  at Oxide.Plugins.EntityLimit.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00221] in <a71865497250490fb63509ee4c185af5>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <9affce1cd15c4ec183941adef8db1722>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <4452f821def6406d834e4149849fe7ea>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <4452f821def6406d834e4149849fe7ea>:0​
In response to Bumfuzzler ():
I 'think' I only started seeing this after the recent patch.

(07:31:37) | Failed to call...
oops, didnt' see above post. will try
In response to Bumfuzzler ():
oops, didnt' see above post. will try
ty @Orange worked!
(09:26:46) | Failed to call hook 'OnEntityDeath' on plugin 'EntityLimit v0.6.3' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.EntityLimit.EntityDestroyed (BaseEntity entity) [0x0005b] in <36787b6bdba14f50b8f77893ec69eff4>:0 
  at Oxide.Plugins.EntityLimit.OnEntityDeath (BaseCombatEntity entity, HitInfo hitInfo) [0x0000d] in <36787b6bdba14f50b8f77893ec69eff4>:0 
  at Oxide.Plugins.EntityLimit.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00221] in <36787b6bdba14f50b8f77893ec69eff4>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <9affce1cd15c4ec183941adef8db1722>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <4452f821def6406d834e4149849fe7ea>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <4452f821def6406d834e4149849fe7ea>:0
(09:26:46) | Failed to call hook 'OnEntityDeath' on plugin 'EntityLimit v0.6.3' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.EntityLimit.EntityDestroyed (BaseEntity entity) [0x0005b] in <36787b6bdba14f50b8f77893ec69eff4>:0 
  at Oxide.Plugins.EntityLimit.OnEntityDeath (BaseCombatEntity entity, HitInfo hitInfo) [0x0000d] in <36787b6bdba14f50b8f77893ec69eff4>:0 
  at Oxide.Plugins.EntityLimit.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00221] in <36787b6bdba14f50b8f77893ec69eff4>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <9affce1cd15c4ec183941adef8db1722>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <4452f821def6406d834e4149849fe7ea>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <4452f821def6406d834e4149849fe7ea>:0
(09:27:00) | "SetDestination" can only be called on an active agent that has been placed on a NavMesh.




Seeing this a little too much in my console now. Is it bad?

In response to Bumfuzzler ():
oops, didnt' see above post. will try
What exactly am I msising or what do I need to do to fix this?

So just put that piece of code in stead of the regular one?
Might be solved after last update
Locked automatically