Jump to content

[1.7.10] Getting if a mob was killed by a player or not


flamedragonX2

Recommended Posts

So I'd like to make the chat have a death message whenever a (non-named) mob was killed by a player. This is easy for melee/ranged attack kills (I just used LivingDeathEvent), but how would I get if a mob was recently hit by a player before death (i.e. if it is thrown off a cliff or into lava)? For example, if I hit the mob and then it falls into lava, I want a death message spawned. However if it just walks into lava on its own there should be no message.

 

The value in the MC source code that keeps track of this so it can spawn XP orbs and stuff is protected so I can't get to it...

 

Is there a way to get a boolean that tells you this?

Link to comment
Share on other sites

Everything really depends on how much data on death you need.

 

You are quite outdated (WHY?!?!?) so I don't remember if MC had CombatTracker (good one) at that time, and even if - it might be poorer than it is now.

 

Anyway - are you referring to field that holds last attacker entity (which might be player)? If there is no getter then you have to either update or use java Reflection (google).

 

Is there a way to get a boolean that tells you this?

 

What boolean?

 

As to other ways - whenever data vanilla gives you is not sufficient you use IExtendedEntityProperties (now 1.8.9+ @Capability) to store more data. That data can be manipulated from anywhere really (so e.g you can track such actions yourself from e.g LivingHurtEvent). Currently some of such tracking is in mentioned CombatTracker, which idk if existed back then (cmon, it's been 2 years, update).

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

Everything really depends on how much data on death you need.

 

You are quite outdated (WHY?!?!?) so I don't remember if MC had CombatTracker (good one) at that time, and even if - it might be poorer than it is now.

 

Anyway - are you referring to field that holds last attacker entity (which might be player)? If there is no getter then you have to either update or use java Reflection (google).

 

Is there a way to get a boolean that tells you this?

 

What boolean?

 

As to other ways - whenever data vanilla gives you is not sufficient you use IExtendedEntityProperties (now 1.8.9+ @Capability) to store more data. That data can be manipulated from anywhere really (so e.g you can track such actions yourself from e.g LivingHurtEvent). Currently some of such tracking is in mentioned CombatTracker, which idk if existed back then (cmon, it's been 2 years, update).

 

I have to start at 1.7.10, mostly because that's the version significant numbers of the mods are. Maybe later I will update to 1.9 or so (may just skip 1.8.9 entirely).

Link to comment
Share on other sites

I have to start at 1.7.10, mostly because that's the version significant numbers of the mods are.

 

1. You don't HAVE TO.

2. If you are implying that 1.9+ (or even 1.8+ for that matter) has no mod base you are simply wrong. Most respectable mods are updated.

3. 1.7.10 is so old that you will get significantly less support here than for recent version.

4. You are making it difficult for yourself (1.7.10 is much more messed up than 1.8.9+).

5. You are missing on a LOT of new features/hooks (seriously, a lot), have fun making sneaky hacks.

 

Maybe later I will update to 1.9 or so (may just skip 1.8.9 entirely).

 

Currently writing anything for 1.7.10 can be called waste of time. Why?

1.7.10 and 1.9+ are so much different (threads, registry, blocks/items, rendering, models, tons of changes like two hands, class and mehtod names etc.) that updating in means of "fixing things" is close to not possible. You will basically have to relearn quite big chunk of API and vanilla systems and then rewrite mod from scratch. On top of that - anything you write regarding rendering will be 100% useless, because of new models/rendering.

 

"I won't update my mod because others haven't updated theirs yet" is alredy bad. "I will write new outdated mod because others haven't updated" is even worse. Seriously, don't be that guy. Waste of efforts and just bad approach.

 

Oh yeah, I found CombatTracker in 1.7.10 and got it to give me a death message, but the thing is I want to use my own custom (random from a selection in a config, the config part is done already) death messages, separate from the original ones.

 

I don't think there is anything (server-side) that would allow catching message to be sent. You can manipulate client received (pre-chat-printing), client to-be-sent and server received, but not server to-be-sent. Unless you would hook into packet pipeline (basically override network pipeline of vanilla).

 

EDIT

 

I'd look for a way to cancel sending death message (there is such thing, idk where tho, maybe even in event). And then send your own from death event (basing off CombatTracker).

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

Okay, I understand what you mean now. Gonna try it out...

 

A significant portion of the mods I play (which are still being updated) haven't yet updated to 1.8.9+, though some of them have said they will update soon. I do want them to update eventually but seeing as my entire playstyle revolves around mods like those I'm sticking with 1.7.10. TBH this mod is more of a personal thing for my own experience that I may not even plan to distribute.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • i notice a change if i add the min and max ram in the line like this for example:    # Xmx and Xms set the maximum and minimum RAM usage, respectively. # They can take any number, followed by an M or a G. # M means Megabyte, G means Gigabyte. # For example, to set the maximum to 3GB: -Xmx3G # To set the minimum to 2.5GB: -Xms2500M # A good default for a modded server is 4GB. # Uncomment the next line to set it. -Xmx10240M -Xms8192M    i need to make more experiments but for now this apparently works.
    • Selamat datang di OLXTOTO, situs slot gacor terpanas yang sedang booming di industri perjudian online. Jika Anda mencari pengalaman bermain yang luar biasa, maka OLXTOTO adalah tempat yang tepat untuk Anda. Dapatkan sensasi tidak biasa dengan variasi slot online terlengkap dan peluang memenangkan jackpot slot maxwin yang sering. Di sini, Anda akan merasakan keseruan yang luar biasa dalam bermain judi slot. DAFTAR OLXTOTO DISINI LOGIN OLXTOTO DISINI AKUN PRO OLXTOTO DISINI   Slot Gacor untuk Sensasi Bermain Maksimal Olahraga cepat dan seru dengan slot gacor di OLXTOTO. Rasakan sensasi bermain maksimal dengan mesin slot yang memberikan kemenangan beruntun. Temukan keberuntungan Anda di antara berbagai pilihan slot gacor yang tersedia dan rasakan kegembiraan bermain judi slot yang tak terlupakan. Situs Slot Terpercaya dengan Pilihan Terlengkap OLXTOTO adalah situs slot terpercaya yang menawarkan pilihan terlengkap dalam perjudian online. Nikmati berbagai genre dan tema slot online yang menarik, dari slot klasik hingga slot video yang inovatif. Dipercaya oleh jutaan pemain, OLXTOTO memberikan pengalaman bermain yang aman dan terjamin.   Jackpot Slot Maxwin Sering Untuk Peluang Besar Di OLXTOTO, kami tidak hanya memberikan hadiah slot biasa, tapi juga memberikan kesempatan kepada pemain untuk memenangkan jackpot slot maxwin yang sering. Dengan demikian, Anda dapat meraih keberuntungan besar dan memenangkan ribuan rupiah sebagai hadiah jackpot slot maxwin kami. Jackpot slot maxwin merupakan peluang besar bagi para pemain judi slot untuk meraih keuntungan yang lebih besar. Dalam permainan kami, Anda tidak harus terpaku pada kemenangan biasa saja. Kami hadir dengan jackpot slot maxwin yang sering, sehingga Anda memiliki peluang yang lebih besar untuk meraih kemenangan besar dengan hadiah yang menggiurkan. Dalam permainan judi slot, pengalaman bermain bukan hanya tentang keseruan dan hiburan semata. Kami memahami bahwa para pemain juga menginginkan kesempatan untuk meraih keberuntungan besar. Oleh karena itu, OLXTOTO hadir dengan jackpot slot maxwin yang sering untuk memberikan peluang besar kepada para pemain kami. Peluang Besar Menang Jackpot Slot Maxwin Peluang menang jackpot slot maxwin di OLXTOTO sangatlah besar. Anda tidak perlu khawatir tentang batasan atau pembatasan dalam meraih jackpot tersebut. Kami ingin memberikan kesempatan kepada semua pemain kami untuk merasakan sensasi menang dalam jumlah yang luar biasa. Jackpot slot maxwin kami dibuka untuk semua pemain judi slot di OLXTOTO. Anda memiliki peluang yang sama dengan pemain lainnya untuk memenangkan hadiah jackpot yang besar. Kami percaya bahwa semua orang memiliki kesempatan untuk meraih keberuntungan besar, dan itulah mengapa kami menyediakan jackpot slot maxwin yang sering untuk memenuhi harapan dan keinginan Anda.  
    • LOGIN DAN DAFTAR DISINI SEKARANG !!!! Blacktogel adalah situs judi slot online yang menjadi pilihan banyak penggemar judi slot gacor di Indonesia. Dengan platform yang sangat user-friendly dan berbagai macam permainan slot yang tersedia, Blacktogel menjadi tempat yang tepat untuk penggemar judi slot online. Dalam artikel ini, kami akan membahas tentang Blacktogel dan keunggulan situs slot gacor online yang disediakan.  
    • Situs bandar slot online Gacor dengan bonus terbesar saat ini sedang menjadi sorotan para pemain judi online. Dengan persaingan yang semakin ketat dalam industri perjudian online, pemain mencari situs yang tidak hanya menawarkan permainan slot yang gacor (sering memberikan kemenangan), tetapi juga bonus terbesar yang bisa meningkatkan peluang menang. Daftar disini : https://gesit.io/googlegopek
    • Situs bandar slot online Gacor dengan bonus terbesar saat ini sedang menjadi sorotan para pemain judi online. Dengan persaingan yang semakin ketat dalam industri perjudian online, pemain mencari situs yang tidak hanya menawarkan permainan slot yang gacor (sering memberikan kemenangan), tetapi juga bonus terbesar yang bisa meningkatkan peluang menang. Daftar disini : https://gesit.io/googlegopek
  • Topics

×
×
  • Create New...

Important Information

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