Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (โ‹ฎ) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Yeah the topic says it is it possible to do that? and its my first time to do this since specifically i want to include Custom Npcs.

It is possible, but not using instanceof. What you need to do is check that the Classes are equal(Use .class or .getClass to get the classes), make sure you only do this if CustomNPCs is loaded.

ย 

It is possible, but not using instanceof. What you need to do is check that the Classes are equal(Use .class or .getClass to get the classes), make sure you only do this if CustomNPCs is loaded.

ย 

ย 

What?

ย 

It's like saying "If you get a key, you can open a lock, but only by using exact copy of that key, not the original."

ย 

If you can compare classes without getting crash (compilation error) you can most certainly can make instanceof keyword.

ย 

Problem of this thread lies here:

Does mod in question have API / dev-release / deobfuscated open source?

You basically need to add it to your project (dependency) depending on what you got from author.

ย 

If you have such dependency you can reference anything in it like you reference vanilla code - also mobs.

ย 

Also remember - if you do such stuff you need to add dependency to your @Mod or take care of things when given "parent" mod is not present.

ย 

As to other "soft" solutions. You can make non-dependency checks. Every entity is registered into EntityRegistry. You can easily compare registry names and/or even class names without having hard dependency.

ย 

P.S:

Oh and btw - if you'd be on 1.8+ you wouldn't have to have deobfuscated mod (dev release) - you could basically just grab it and throw into libs. BOOM - in your face pre-1.8! But seriously - update (magic of new things).

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

I believe that he wants to grab an instance of the entity not create one as, creating a new instance of a CustomNPC Entity would be kinda pointless since you would be able to call any of the functions added by Custom NPCs.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions โ†’ Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.