Jump to content


Photo

Minecraft


  • Please log in to reply
2102 replies to this topic

#2101 Brawl

Brawl

    Magnitude Games

  • Retired Staff
  • 463 posts
  • Version:GM:Studio

Posted Yesterday, 03:00 AM

The in game setup isn't all there is to see.  MCEdit was used to alter the data of some blocks to make them use sand/gravel physics.  All blocks are basically the same (likely using a parent block which contains most of the code for the blocks) so one block's properties could be applied to most other blocks.


  • 0

#2102 Geemili

Geemili

    GMC Member

  • GMC Member
  • 129 posts
  • Version:GM8

Posted Yesterday, 03:42 AM

The blocks work like this:

When you spawn a falling sand entity it checks the block id where it was at. If it is the same id as the block, it changes the block to air. If it isn't, it despawns. However, there are ways to get around it despawning.

 

Using this, you can replace a block by spawning two falling sand entities at once. The first one is the new block. Second, you spawn the original block, slightly higher. This removes the block, and by spawning it slightly higher you make it so that when it falls down, it will destroy itself because the block is already occupied.

 

At least, that's how I think it works.


  • 0

#2103 yokcos700

yokcos700

    Friendly Overlord

  • GMC Member
  • 252 posts
  • Version:GM:HTML5

Posted Yesterday, 11:09 AM

The blocks work like this:

When you spawn a falling sand entity it checks the block id where it was at. If it is the same id as the block, it changes the block to air. If it isn't, it despawns. However, there are ways to get around it despawning.

 

Using this, you can replace a block by spawning two falling sand entities at once. The first one is the new block. Second, you spawn the original block, slightly higher. This removes the block, and by spawning it slightly higher you make it so that when it falls down, it will destroy itself because the block is already occupied.

 

At least, that's how I think it works.

I saw a few videos on it, and that's mostly right. However:

 

Falling sand entities have a very respectable amount of NBT tags, including the block they are, the damage they deal and even the data associated with the block they are (so you could make a chest fall from the sky and already have items in it).

One of these tags is Time. When falling sand normally spawns, its Time is equal to 1, and it ticks up every game tick (0.05s). However, if you spawn it with Time equal to 0, the first thing it will do is it will increase to 1. Only when the time increases to 1 will the Geemili's information come into play. The first block spawned in the space (the block that will be replaced) is spawned with Time equal to 0 so that it destroys the block, and the other one (the block which will appear) is spawned with Time equal to 1 or more, so that it doesn't instantly despawn.

 

And then there's redstone-activated spawners.


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users