Getting MobType and related actions

Discussion in 'Plugin Development' started by Infernus, Mar 3, 2011.

Thread Status:
Not open for further replies.
  1. Offline


    As I've seen in my code I had to add a 'Suppress Warning':


    So I am actually looking for a way to not use this SuppressWarning, code:

    void onCreatureSpawn(CreatureSpawnEvent event)
    Yeah, guess what, it's my creeperpreventer! ;)

    And my second question is, how do I change for example the health of a spawning creature? Would be nice to know as I have a plan for an upcoming mod :)

    Thanks for your support!
  2. Offline


    Funny, I discover another post by you.
    You can change the health of any LivingEntity using the setHealth and getHealth functions (or is it called methods in Java?).
    Try changing the @SuppressWarning to @Override
  3. Offline


    yes, "methods" in Java.

    the @Override annotation tells Java that you want this method to take priority over the Listener class which you are extending. similarly, the @SuppressWarning tells your compiler, "please don't show me warnings about this section."
  4. Offline


    The problem is that mobType is deprecated - you should use creatureType instead
  5. Offline


    Thanks! I will soon take a look into this.
Thread Status:
Not open for further replies.

Share This Page