1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- event.load("entity_click");
- event.load("block_click");
- event.load("entity_join");
- Fun_Block = "minecraft:red_wool";
- Wool_loc = loc.new(games, -459, 164, -65);
- tag = text.concat("{BlockState:{Name:\"", Fun_Block, "\"},Time:1,Motion:[0.0,0.5,0.0],DropItem:1,HurtEntities:0}");
- msg("dev", "§bLuftballon §rloaded.");
- @Luftballon_loop
- msg("dev", event);
- wait();
- if(event == "block_click" ){
- if(inRegion(block_loc) && block_type == Fun_Block){
- block.set(block_loc, "minecraft:air");
- block_loc = loc.new(loc.getWorld(block_loc),loc.getX(block_loc)+0.5,loc.getY(block_loc),loc.getZ(block_loc)+0.5);
- falling_block_entity = entity.spawn("falling_block", block_loc, tag);
- }
- goto("Luftballon_loop");
- }
- if(event == "entity_click"){
- if(inRegion(entity.getLocation(entity)) && entity.getType(entity) == "falling_block"){
- throw(player, falling_block_entity);
- }
- goto("Luftballon_loop");
- }
- if(event == "entity_join"){
- e = entity.getType(entity);
- msg("dev",e);
- msg("dev", "ja");
- /*if(item.entity.get(entity) == "red_wool" && inRegion(entity.getLocation(entity))){
- cancel = true;
- block.set(Wool_loc, "minecraft:red_wool");
- }*/
- }
- goto("Luftballon_loop");
- function inRegion(temp_loc){
- temp_x = loc.getX(temp_loc);
- temp_y = loc.getY(temp_loc);
- temp_z = loc.getZ(temp_loc);
- if(-450 > temp_x && temp_x > -467 && 162 < temp_y && temp_y < 173 && -59 > temp_z && temp_z > -70){
- return(true);
- }
- return(false);
- }
- function throw(p, entity_to_throw){
- array = entity.getLook(p);
- x = array[0]*0.225 + math.random(0,0.25) - math.random(0,0.25);
- y = math.abs(array[1])*0.25 + math.random(0.75,0.95) + 0.5;
- z = array[2]*0.225 + math.random(0,0.25) - math.random(0,0.25);
- entity.throw(entity_to_throw, x, y, z);
- }
|