Jump to content

ravand

Members
  • Posts

    4
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

ravand's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. @ thebest108 Yes you are right, i realized that too late after trying numerous things(also the ones suggested above) but none of them really worked. The ASM method is dirty and tideous to work with but at least it is working now, guess i have to get used to it. I emptied the onEntityCollidedWithBLock() method inside the BlockWeb class, for anyone who is interested in doing this. Thanks for your help
  2. @coolAlias Thanks for your post! I was aware , when i extended the Entity class, that i was creating a new Entity class, however i thought i could replace an entities behaviour by assigning the new Entity class when the Entity was spawned for example. I do something similiar when the MainMenu load event is called to add custom buttons. I will look further into the onEntityCollidedWithBlock event a bit later when i have some time. Would you be so kind and provide an example? Also i have tried using the LivingUpdateEvent however there is 1 problem, the isInWeb field is protected I will try modifying them with a Reflection class. Thanks in advance!
  3. I am trying to completely remove the effect of cobwebs slowing down the player or any other entity. I had already looked into the Blocks class but none of the methods or fields helped there (i think). Maybe there is an easier mor straight forward way to prevent this, like canceling a certain event maybe? So im not really trying to make a new entity, no. The entity class has this MoveEntity method (don't know exact name atm, not at home sry) that checks if the entity has the "isInWeb" property set, which is handled by the "setInWeb()" method, which is why i want to override that method. So question still remains, is this override even possible so it effects every Entity without coremods?
  4. Hello Forge Community, I am pretty new to modding in minecraft and starting to get a bit into the forge API so bare with me: What i want to do is removing the Entity slow property when a player is inside a cobweb by overriding the setInWeb() method from the Entity class. My problem is, that i haven't figured out a way to actually make use over the overriden method of the super class and at this point im not even sure if it is possible without using ASM. What i've got so far: public class WebSlow extends Entity{ public WebSlow(World p_i1582_1_) { super(p_i1582_1_); } @Override public void setInWeb() { this.isInWeb = false; } @Override protected void entityInit() { } @Override protected void readEntityFromNBT(NBTTagCompound p_70037_1_) { } @Override protected void writeEntityToNBT(NBTTagCompound p_70014_1_) { } I will probably need a way to constantly set field "isInWeb" to false (which the setInWeb() method does) but i haven't found any onPlayerMove events or anything similiar, i have tried it with the "EntityJoinWorld" event but that didn't work out. Is what im trying to do the right approach, is there any other way to prevent the web slow or is the use of ASM inevitable? I would appreciate any suggestions to solve my little mod problem. Thans in advance
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.