[NMS] DataWatchers stuff

Discussion in 'Plugin Development' started by Agentleader1, Jul 21, 2015.

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

    Agentleader1

    I'm completely new to datawatchers. I read a tiny article about datawatchers so now I know I can add an object to a certain id to make it do stuff. That I don't even know. I heard you can use datawatchers to make an EntityCreeper expand and by turn explode and some other cool things. Is there a javadoc/tutorial/document I can view to know all about datawatchers or at least get a grasp. I want to know what you must do to make an EntityCreeper expand and anything else and what methods/functions would do what. Thank you very much!

    As well, I'd like to know how to make an EntityLiving not disappear when too far away. I've been using EntityLivings for disguising players, but now I can not seem to figure out why they would disappear after being too far away.
     
  2. xTrollxDudex likes this.
  3. Offline

    Agentleader1

  4. Offline

    ShadowLAX

    @Agentleader1 To set if an entity is removed when far away modify the "persistent" field. False causes it to be removed, true causes it to not be removed.
     
  5. Offline

    Agentleader1

    @ShadowLAX I was unable to find an EntityLiving's persistent field, is it a private field and I must set the field with reflection? If not, what might the variable name be?
     
  6. Offline

    ShadowLAX

    @Agentleader1 It's a field in EntityInsentient, which directly extends EntityLiving. All mobs indirectly extend EntityInsentient.
     
  7. Offline

    xTrollxDudex

    Data watchers manipulate entity metadata, as said already , documentation can be found at wiki.vg
     
  8. Offline

    Agentleader1

    I apparently tried to set an EntityLiving's (EntityInsentient's really) persistent field and appears that it doesn't work. Me and my friend just tried it a few minutes ago prior to this post.
     
  9. Offline

    ShadowLAX

    @Agentleader1 I tested it before I posted it and looked through the NMS code relating to it. You might have another plugin conflicting with the field and/or removing the entities automatically.
     
  10. Offline

    Agentleader1

    @ShadowLAX
    Are you sure this is supposed for EntityLivings and not pre-spawned Entities?
     
  11. Offline

    ShadowLAX

    @Agentleader1 Yes, I tested the field by setting my custom entities' own persistent field, which I had to manually spawn in.
     
Thread Status:
Not open for further replies.

Share This Page