How would I setup my plugin to use a unique fieldlayout that is unique to the top level of the plugin?
You're bumping into this error because of a minor misunderstanding of how Pixel &amp; Tonic are referencing their Element Types. The problem you have is with this line of code:

$fieldLayout-&gt;type = ElementType::MyElementType;


When P&amp;T use that syntax, it's because they've already pre-defined all of their element types as enums. Open up the /app folder and take a look at this file to see what they've done:


  /craft/app/enums/ElementType.php


This allows them to use a syntax like ElementType::Asset.

You don't have that option (unless you create your own enum). What you would do instead, simply use a normal string to specify your element type:

$fieldLayout-&gt;type = 'MyPlugin_MyElementType';


This is the same string that you wrote when you defined the Model for your Element Type. It should be one of the first lines of code within your Model:

protected $elementType = 'MyPlugin_MyElementType';


Setting up enums is a different topic, but just go ahead and use the string and it should resolve that error for you!