Jump to content

Brokkoli3000

Members
  • Posts

    9
  • Joined

  • Last visited

Brokkoli3000's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. And the data of this capability will be accessible always because the overworld is always loaded on the server side?
  2. Hey guys, what would be the best way to store per-world data? With world I don't mean level but a conglomerate of all levels; so in my terminology a world is for example one of the elements in the single player world list. As far as I can see, capabilities can only be stored for single levels, but not for a whole world...🤔
  3. I think this would not meet my requirements well enough, because then the villager would disappear in the old dimension as soon as the player changes his dimension. This would even happen if another player stands in the old dimension watching the portal and thus wondering where the villager who was several meters away suddenly disappeared to. So if somebody is watching the portal, the villager should fully get to the portal and disappear then. So I figured, the event I am actually looking for is when the villager gets removed from the world or does not get updated anymore. Btw: In the meantime I found out that adding these startTick and endTick events to EntityTickList wouldn't suffice, because for example the whole level might not get ticked.
  4. Hi! I am trying to implement villagers following the player and want this to be possible also across dimensions. Now the problem is that the villager can't follow into a portal if his dimension gets unloaded too quickly. That's why my idea is to watch out for an event where the villager gets unloaded and teleport him to the target dimension then. But I found out that the EntityLeaveWorldEvent is generated rather rarely, probably when some dedicated entity cache overflows or something and certainly not just when the player changes the dimension. If the event hasn't been generated yet, the entity might still not receive ticks anymore because of the quite sophisticated Minecraft ticking functionality. I checked the code but couldn't find any Forge events generated when ticking of an entity starts and ends. From what I understand is that ticking entities are managed by net.minecraft.world.level.entity.EntityTickList. There, the events could maybe be generated. Of course, I could hack around it, but in my opinion a Forge event would be appropriate here. Am I missing something? If not, could you please introduce this?
  5. Ah ok, this copying would be a possibility. I tried with overriding the EntityType for villager, but this led to the aforementioned problems. But than I'll try this other approach. Yeah exactly if I already extend the Villager class, then it shouldn't be a problem in the end. About the ATs: I tried them out and couldn't change visibility of fields. Probably because I used the deobfuscated names but read that it should be obfuscated names. But how do I get the original unreadable names if I already have the readable ones? I actually don't really understand how Forge plugs different mods with different ATs together. Are the visibilities not available anymore in byte code, such that the ATs are only supposed to ensure that the mod code compiles? And also: I updated to the newest version of Forge (39.0.8) and the additional jars (e.g. Forge events) are not shown in Eclipse anymore (probably they're gone?). Is this supposed to happen? If this is already too off-topic, I can of course open a new thread.
  6. I did exactly this and added a Behavior there. Problem is, when the profession of the villager is reset, Villager.refreshBrain is called, which removes my behavior. And I can't find a way to listen for such a profession reset to add the behavior afterwards again. So my updated approaches would be: - Extend villager, but I couldn't find out how to replace all vanilla villagers with my custom class. - Extend Brain and override the copyWithoutBehaviors method. Here the problem is that an extending class does not have access to the Brain.MemoryValue class. This could be hacked by using the access transformers maybe but it would be a dirty way... Any more ideas?🤔
  7. Hey guys, I am trying to extend the vanilla villager behavior. Currently it shall be possible to talk to them via a simple GUI with choosable options like in other games. During these talks the villager shall follow the player with head and body exactly like during trading. I am still trying to figure out vast parts of the Minecraft code of the new version. I think the safest way to go would be to extend the villager CORE activity added in the Villager.registerBrainGoals method. There, an additional behavior could be added which mostly adopts the LookAndFollowTradingPlayerSink class. But I can't find a way to add this behavior to the activity. I mainly see two possibilities: Intercepting every call to this method and replacing it by a copy including the additional behavior (but I can't find suitable Forge events). Or replacing the villager class by an own class extending Villager. Here I can't figure out how to do it properly in Minecraft 1.18. When I try to replace the entity type there is no error but also no villager shows up at all. But it doesn't seem to be just a rendering problem, because the constructor of my own villager class isn't even called. Does anyone here have experience with villagers in the new version? Is my behavior approach generally good or would another variant be much easier and better? If the approach is good, how to get the additional behavior into the villager? Thanks in advance! :)
×
×
  • Create New...

Important Information

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