Have your block extend BlockContainer and spawn your tile entity by overriding BlockContainer'screateNewTileEntity method.
EDIT: I don't believe you can spawn tile entities at a player's position or generally without a block. Even if you can it will probably lead to issues.
The Meaning of Life, the Universe, and Everything.
Join Date:
11/17/2016
Posts:
363
Location:
USA (sadly)
Minecraft:
FavouriteDragon
Member Details
oh ok.... Do you know how to make some sort of laser that spawns at a player's position? I'm trying to make a water cannon (giant water laser that takes a couple seconds to charge)
Best I can think of is an entity, and a renderer for it.
I'd include start and end positions of the beam in the entity for the renderer. As for what happens to entities/blocks that collide with the beam, I'd handle this by raytracing any entities/blocks on the beam's path in spawn/item use, however it probably could be done from the entity's code, but I wouldn't know how.
For the renderer you'll need some textures and a model (probably should be extendable). I'd check the beacon's code to see how that works.
EDIT: Looks like your memory isn't garbage bad then.
EDIT: You could also avoid creating an entity entirely and use particles instead, however that way your beam won't seem quite solid, but depending on what you want might look better. You could also combine the entity with particles which can look nice as well. If you don't like vanilla particles you could always make your own.
Have your block extend BlockContainer and spawn your tile entity by overriding BlockContainer'screateNewTileEntity method.
Don't extend BlockContainer or implement ITileEntityProvider, these are outdated. Instead, override Block#hasTileEntity(IBlockState) and Block#createTileEntity.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Don't extend BlockContainer or implement ITileEntityProvider, these are outdated. Instead, override Block#hasTileEntity(IBlockState) and Block#createTileEntity.
Oh, sorry, didn't know that. I usually look at how vanilla does things when I don't know something and vanilla does it the outdated way. Good thing OP wasn't looking for a tile entity in the first place.
If I was trying to make a custom tile entity spawn from me (like a laser), how would I do that?
Tutorials please, if you don't want to waste time telling me yourself.
Image Removed
~ Everybody's FavouriteDragon
Have your block extend BlockContainer and spawn your tile entity by overriding BlockContainer's createNewTileEntity method.
EDIT: I don't believe you can spawn tile entities at a player's position or generally without a block. Even if you can it will probably lead to issues.
oh ok.... Do you know how to make some sort of laser that spawns at a player's position? I'm trying to make a water cannon (giant water laser that takes a couple seconds to charge)
P.S I seem to remember you from somewhere....
Image Removed
~ Everybody's FavouriteDragon
Best I can think of is an entity, and a renderer for it.
I'd include start and end positions of the beam in the entity for the renderer. As for what happens to entities/blocks that collide with the beam, I'd handle this by raytracing any entities/blocks on the beam's path in spawn/item use, however it probably could be done from the entity's code, but I wouldn't know how.
For the renderer you'll need some textures and a model (probably should be extendable). I'd check the beacon's code to see how that works.
EDIT: Looks like your memory isn't
garbagebad then.EDIT: You could also avoid creating an entity entirely and use particles instead, however that way your beam won't seem quite solid, but depending on what you want might look better. You could also combine the entity with particles which can look nice as well. If you don't like vanilla particles you could always make your own.
Ok thanks for the advice!
I'll report on what happens. Hehe. You will not be left in peace
Image Removed
~ Everybody's FavouriteDragon
Don't extend BlockContainer or implement ITileEntityProvider, these are outdated. Instead, override Block#hasTileEntity(IBlockState) and Block#createTileEntity.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Oh, sorry, didn't know that. I usually look at how vanilla does things when I don't know something and vanilla does it the outdated way. Good thing OP wasn't looking for a tile entity in the first place.