• Hello Guest! Did you know that ProjectKorra has an official Discord server? A lot of discussion about the official server, development process, and community discussion happens over there. Feel free to join now by clicking the link below.

    Join the Discord Server

Temp-Block Tutorials?

xNuminousx

Verified Member
Anyone know any good tutorial (whether it's video or text) that can sort of teach the ~ways~ of the temp blocks? I'd like to learn how to mess with them when I get all my electricity up and running again.
 

MeskenasBoii

Verified Member
Might not be any, as temp blocks is just PK exclusive thing. Though reading the sources of custom/stock abilities that use them would be a good starting step perhaps?
 

xNuminousx

Verified Member
Might not be any, as temp blocks is just PK exclusive thing. Though reading the sources of custom/stock abilities that use them would be a good starting step perhaps?
Temp blocks are only a Pk thing? Waaattt

I thought if anything Pk just made it easier to work with them.
 

Finn_Bueno_

Staff member
Plugin Developer
Verified Member
TempBlocks represent temporary blocks placed by bending that should revert back to their original state eventually and drop the item of the original block. Note: Earthbendable blocks that have been earthbent are NOT tempblocks.

They are used to create a different block at a certain location and revert it later.

To create one, create a new instance of TempBlock. To the constructor you pass the material and data the new block should have, and the location of the block you wish to create the tempblock at. Then the BlockState of the original block will be saved, and the block will be replaced with the material and data you specified.

Assuming you're doing this in an ability class, you're gonna have to save this instance somewhere. Most commonly it's saved in some Collection because most of the time you're gonna create a number of tempblocks. So when you create one, save it to a collection.

Then when it's time to remove the temblocks (for example, when the ability ends), loop through your collection and call 'revert();' on each instance. Then clear the collection. That's it!
 

xNuminousx

Verified Member
TempBlocks represent temporary blocks placed by bending that should revert back to their original state eventually and drop the item of the original block. Note: Earthbendable blocks that have been earthbent are NOT tempblocks.

They are used to create a different block at a certain location and revert it later.

To create one, create a new instance of TempBlock. To the constructor you pass the material and data the new block should have, and the location of the block you wish to create the tempblock at. Then the BlockState of the original block will be saved, and the block will be replaced with the material and data you specified.

Assuming you're doing this in an ability class, you're gonna have to save this instance somewhere. Most commonly it's saved in some Collection because most of the time you're gonna create a number of tempblocks. So when you create one, save it to a collection.

Then when it's time to remove the temblocks (for example, when the ability ends), loop through your collection and call 'revert();' on each instance. Then clear the collection. That's it!
Very helpful thank you. I will definately try it out on my own when I am able to.
 

MeskenasBoii

Verified Member
TempBlocks represent temporary blocks placed by bending that should revert back to their original state eventually and drop the item of the original block. Note: Earthbendable blocks that have been earthbent are NOT tempblocks.
Surely you refer only to RaiseEarth, Collapse and EarthTunnel? Earthblast, earthsmash, and shockwave are temps, because they disappear immediately.
 

xNuminousx

Verified Member
Surely you refer only to RaiseEarth, Collapse and EarthTunnel? Earthblast, earthsmash, and shockwave are temps, because they disappear immediately.
Those both use the same form of temp block I believe. Only, one disappears at a different time than the others.
 

xNuminousx

Verified Member
Would it be safe to say Earth is generally an example of non-tempblocks where water is an example of tempblock? Since most Earth moves revert where most water moves don't.
 
Top