generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
quazarith lester spawn (non raycast)
- Loading branch information
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/main/java/net/ugi/sculk_depths/block/custom/LesterSpawningBlock.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package net.ugi.sculk_depths.block.custom; | ||
|
||
import net.minecraft.block.Block; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.World; | ||
import net.minecraft.world.WorldAccess; | ||
import net.ugi.sculk_depths.entity.ModEntities; | ||
import net.ugi.sculk_depths.entity.custom.LesterEntity; | ||
|
||
public class LesterSpawningBlock extends Block { | ||
public LesterSpawningBlock(Settings settings) { | ||
super(settings); | ||
} | ||
|
||
@Override | ||
public void onBroken(WorldAccess world, BlockPos pos, BlockState state) { | ||
if(world.isClient())return; | ||
Entity entity = new LesterEntity(ModEntities.LESTER, (World) world); | ||
|
||
entity.setPosition(pos.getX(),pos.getY(),pos.getZ()); | ||
world.spawnEntity(entity); | ||
} | ||
} |