[HOW TO] Mobs that give off light!

Started by SuperBully on

Topic category: User side tutorials

Last seen on 06:32, 14. Sep 2021
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[HOW TO] Mobs that give off light!
Sun, 07/12/2020 - 20:25 (edited)

This is very specific and roundabout way to do this, so this might not work for everybody.

This tutorial will teach you how to create a mob that gives off light. This method spawns a no-collisions block at the location of the mob and deletes it when they walk away. You will need to follow these steps in this order!

Step One: Create a light block.

-Create a 16x16 image that is completely empty so that it appears invisible ingame.

-Create a new 'Block' mod element.

https://imgur.com/a/JNMR0qu

-It is important that you have transparency checked, as well as edit the block bounding box coords. You want this box to be as small as possible so people don't accidentally hit if trying to attack your mob.

https://imgur.com/a/cd9DYiF

-Next, you'll want to make sure the material is Air, and that it has no creative tab entry. It's Hardness and Resistance should be 0. Luminance can be defined however bright you'd like your light to be.

-Make sure you can walk through the block, and that the custom drop and creative pick item are air, just in case somebody does actually manage to break it, it wont give them anything.

-The block needs to be replaceable just incase somebody is building in the area, we want people to not even think that the block exists.

-The rest of the settings are up to you!

Step Two: Create Your Mob

-Create your mob. I've used a custom model and custom textures, but you can use whatever you like. I think you should try using the glow texture just to make the parts that you want the light to be coming from to glow a little.

-Everything about the mob is up to you, but I recommend making it slower to make the illusion work a little better.

Step Three: Create Your Procedure

-Within your mobs settings, create a procedure under the "On Entity Tick Update."

-We are essentially going to place a block at the mob's head (Y + 1) and delete any instances of the block that are next to it.

https://imgur.com/a/8Y1iLuV

-The first if statement checks if Y + 1 has Air or Cave Air, and then places one of our light blocks at the same location. (Every empty slot is the light block, and every one with an invisible block is air.)

-Every following statement checks if there is a light block in a 3x3 cube around the light, by searching different x, y, and z values, then replaces the light with air. (You could probably do this easier with a /fill command or a variable.)

Step Four: Test!

-Compile everything and spawn your mob!

https://imgur.com/a/D2sJiSC

https://imgur.com/a/epiHDIt

https://imgur.com/a/oUIhjIg

[I know there's a few problems if two of these same mobs get close to one another, but nothing too serious.]

Edited by SuperBully on Sun, 07/12/2020 - 20:25
Last seen on 17:49, 25. Mar 2021
Joined Jun 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Nice tutorial :) (And lol…
Sat, 07/11/2020 - 08:25

Nice tutorial :)

(And lol that's exactly how the Kobold from the one of my mods work XD)

Anyway, I don't know if things changed during the last updates, but traslucent should only be used when the texture has partially transparent pixels (like stained glass): if it only has either completely opaque or entirely transparent pixels it should just be set to transparent to prevent lag

Last seen on 09:48, 26. Sep 2022
Joined Jun 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I've known this already but…
Sat, 07/11/2020 - 08:44

I've known this already but what about underwater ?

Last seen on 03:10, 19. Feb 2022
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I can't see the images D:
Sun, 07/12/2020 - 13:43

I can't see the images D:

Last seen on 17:49, 25. Mar 2021
Joined Jun 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@minheragon12345 I think you…
Sun, 07/12/2020 - 13:45

@minheragon12345 I think you should wait for waterlogged support for that, upvote the ticket on the tracker if you want it added sooner

Last seen on 17:49, 25. Mar 2021
Joined Jun 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@crispy_chips I didn't even…
Sun, 07/12/2020 - 14:36

@crispy_chips I didn't even realize there were images, my browser only rendered their titles as a text XD

Last seen on 06:32, 14. Sep 2021
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The images should be working…
Sun, 07/12/2020 - 19:40

The images should be working now!

Last seen on 15:09, 2. Sep 2021
Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
this is helpful, and your…
Fri, 07/24/2020 - 11:16

this is helpful, and your mob is really cool!

Last seen on 05:55, 20. Aug 2020
Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can you please help me make…
Wed, 08/05/2020 - 16:46

Can you please help me make my armor model for my mod I wanted to make a 3d model but now I just want an at least close to an accurate model of what the item in hand looks like if you can help I'd gladly appreciate it, I'll even add an item to shout you out. here is what the armor unequipped looks like: https://imgur.com/a/LaBY4B9

Last seen on 19:53, 2. Jun 2021
Joined Sep 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
its amazing the solutions we…
Fri, 10/30/2020 - 20:05

its amazing the solutions we must try to get by simple coding that Mojang is to lazy... i mean minecraft is how old now? 10-15y? they could not even implement colored lights so far, no light on entities or items, and such... the only reason minecraft is still alive are the MODDERS, if was just Mojang this game would be dead 5 years ago.

Last seen on 15:18, 19. Mar 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
One thing that you can get…
Sun, 02/18/2024 - 19:43

One thing that you can get away with adding is an occasional update tick to your custom block and if a player doesn't exist next to it, it replaces itself with air.