この動画のコマンドについて。
物理法則コマンドの記載のお願いがあったので載せます。
playanimation @e[type=fox,tag=block] animation.player.sleeping none 0 “” controller.animation.fox.move
playanimation @e[type=fox,tag=block] animation.player.attack.positions none 0 “
v.xbasepos=0;
v.ybasepos=0;
v.zbasepos=0;
v.xpos=v.xpos??0;
v.ypos=v.ypos??16;
v.zpos=v.zpos??0;
v.xvec=v.xvec??32*math.random(0,1);
v.yvec=v.yvec??0;
v.zvec=v.zvec??32*math.random(0,1);
v.xrot=v.xrot??0;
v.yrot=v.yrot??0;
v.zrot=v.zrot??0;
v.omega_x=v.omega_x??0;
v.omega_y=v.omega_y??0;
v.omega_z=v.omega_z??0;
v.scale=v.scale??1;
v.adscale=math.sqrt(v.scale);
v.adscaled=2.1385*v.adscale;
v.radius=v.adscaled/2;
v.tilt=v.tilt??0;
v.tiltvec=v.tiltvec??0;
v.tiltvec_prev=0;
v.is_slip=0;
v.is_on_ground_prev=0;
v.gravity=-9.8;
v.restitution=0.64;
v.coe_res=0.64;
v.friction=0.8;
v.floor_height=0;
v.floor_friction=1;
v.world_x=v.world_x??q.position(0);
v.world_y=v.world_y??q.position(1);
v.world_z=v.world_z??q.position(2);
” initial
playanimation @e[type=fox,tag=block] animation.creeper.swelling none 0 “
v.delta=(q.life_time-(v.life_time??q.life_time))*4;
(v.delta>0.05)?{v.delta=0.05;};
v.is_on_ground=0;
v.delta_x=v.xvec*v.delta;
v.delta_y=(v.yvec+v.gravity*v.delta)*v.delta;
v.delta_z=v.zvec*v.delta;
v.yvec=v.yvec+v.gravity*v.delta;
v.xpos=v.xpos+v.xvec*v.delta+v.radius*v.tilt*math.cos(v.yrot)*v.delta*6.4*(1-v.is_slip);
v.ypos=v.ypos+v.yvec*v.delta;
v.zpos=v.zpos+v.zvec*v.delta+v.radius*v.tilt*math.sin(v.yrot)*v.delta*6.4*(1-v.is_slip);
v.xrot=v.xrot+v.omega_x*v.delta*16*v.adscaled;
v.yrot=v.yrot+v.omega_y*v.delta;
v.zrot=v.zrot+v.omega_z*v.delta;
v.len=math.sqrt(math.pow(v.xvec,2)+math.pow(v.zvec,2));
v.cos=math.cos(v.xrot);
v.sin=math.sin(v.xrot);
v.e0_y=v.radius*v.cos-v.radius*v.sin;v.e0_z=v.radius*v.sin+v.radius*v.cos;
v.e1_y=v.radius*v.cos+v.radius*v.sin;v.e1_z=v.radius*v.sin-v.radius*v.cos;
v.e2_y=-v.radius*v.cos-v.radius*v.sin;v.e2_z=-v.radius*v.sin+v.radius*v.cos;
v.e3_y=-v.radius*v.cos+v.radius*v.sin;v.e3_z=-v.radius*v.sin-v.radius*v.cos;
v.underedgey=math.min(math.min(v.e0_y,v.e1_y),math.min(v.e2_y,v.e3_y));
v.min_y=(-v.radius-v.underedgey)*7.5;
v.e_z=v.e0_z;
(v.underedgey==v.e1_y)?{v.e_z=v.e1_z;};
(v.underedgey==v.e2_y)?{v.e_z=v.e2_z;};
(v.underedgey==v.e3_y)?{v.e_z=v.e3_z;};
v.e_z=v.e_z;
(v.ypos-v.radius-v.min_y<=v.floor_height)?{v.is_on_ground=1;};
v.tiltvec=0;
v.is_slip=0;
(v.is_on_ground)?{
v.ypos=v.floor_height+v.radius+v.min_y;
v.yvec=-v.yvec*v.coe_res;
v.xvec=v.xvec*v.restitution;
v.zvec=v.zvec*v.restitution;
(math.abs(v.xvec)<0.1)?{v.xvec=0;};
(math.abs(v.yvec)<0.1)?{v.yvec=0;};
(math.abs(v.zvec)<0.1)?{v.zvec=0;};
v.is_slip=((v.e_z<-v.radius*(v.friction*v.floor_friction))||(v.e_z>v.radius*(v.friction*v.floor_friction)));
v.is_near_90=math.abs(v.xrot-math.round(v.xrot/90)*90);
(v.is_near_90>1||(math.abs(v.tilt)>0.1))?{
(v.e_z<0)?{v.tiltvec=0.7;};
(v.e_z>0)?{v.tiltvec=-0.7;};
}:{v.tilt=0;};
(!v.is_on_ground_prev)?{
(v.len!=0)?{v.tiltvec=v.tiltvec+v.len*v.delta*6.4;};
};
};
v.tilt=v.tilt+v.tiltvec*v.delta;
v.yrot=math.sqrt(math.pow(v.delta_x,2)+math.pow(v.delta_z,2))<=v.delta*2?v.yrot:math.atan2(v.delta_z, v.delta_x);
v.omega_x=v.radius*math.sqrt(math.pow(v.delta_x,2)+math.pow(v.delta_z,2))+v.tilt;
v.is_on_ground_prev=v.is_on_ground;
v.tiltvec_prev=v.tiltvec;
v.swelling_scale1=v.adscaled;
v.swelling_scale2=v.adscaled;
v.life_time=q.life_time;
” update
playanimation @e[type=fox,tag=block] animation.ender_dragon.neck_head_movement none 0 “
v.world_delta_x=v.world_x-q.position(0);
v.world_delta_y=v.world_y-q.position(1);
v.world_delta_z=v.world_z-q.position(2);
v.adjust_xz=8*v.adscaled+v.zbasepos/v.adscaled;
v.adjust_y=(-5-v.ybasepos/v.adscaled/v.adscaled)*v.adscaled;
v.x=v.xbasepos/v.adscaled;
v.y=v.adjust_y;
v.z=v.adjust_xz;
v.ty=v.y*math.cos(v.xrot)-v.z*math.sin(v.xrot);
v.tz=v.y*math.sin(v.xrot)+v.z*math.cos(v.xrot);
v.y=v.ty;
v.z=v.tz;
v.tx=-v.x*math.cos(v.zrot)+v.y*math.sin(v.zrot);
v.ty=v.x*math.sin(v.zrot)+v.y*math.cos(v.zrot);
v.x=v.tx;
v.y=v.ty;
v.tx=v.x*math.cos(v.yrot)+v.z*math.sin(v.yrot);
v.tz=-v.x*math.sin(v.yrot)+v.z*math.cos(v.yrot);
v.x=v.tx;
v.z=v.tz;
v.head_position_x=v.x-v.zpos/v.adscaled-v.world_delta_z*7.8;
v.head_position_y=7.48/v.adscale+v.z-v.xpos/v.adscaled-v.world_delta_x*7.8;
v.head_position_z=v.y-v.ypos/v.adscaled-v.world_delta_y*7.8;
v.head_rotation_x=90+v.xrot;
v.head_rotation_y=v.zrot;
v.head_rotation_z=v.yrot;
” posrot
サッカーの場合はこちらも追加してください。
playanimation @a animation.player.attack.positions none 0 “
(q.is_local_player)?{
t.player_x=q.position(0);
t.player_y=q.position(1);
t.player_z=q.position(2);
t.speed=q.ground_speed;
};
” player_position
playanimation @e[type=fox,tag=block] animation.player.attack.positions none 0 “
((v.scale??0)>0)?{
v.base_x=q.position(0);
v.base_y=q.position(1);
v.base_z=q.position(2);
v.body_x=v.base_x+v.xpos/16;
v.body_y=v.base_y+v.ypos/16;
v.body_z=v.base_z+v.zpos/16;
v.player_x=t.player_x??-10000;
v.player_y=t.player_y??-10000;
v.player_z=t.player_z??-10000;
v.delta_x=v.body_x-v.player_x;
v.delta_y=v.body_y-v.player_y;
v.delta_z=v.body_z-v.player_z;
t.x=-v.xpos;
t.y=v.ypos;
t.z=v.zpos;
v.len=math.sqrt(math.pow(v.delta_x,2)+math.pow(v.delta_y,2)+math.pow(v.delta_z,2));
(v.len<1.5)?{
v.xvec=v.delta_x*2*(t.speed<3?3:t.speed);
v.yvec=v.delta_y*2*(t.speed<3?3:t.speed);
v.zvec=v.delta_z*2*(t.speed<3?3:t.speed);
};
};
” soccer
フェイクアイテムのコマンド
playanimation @e[type=fox,tag=item] animation.player.sleeping none 0 “” controller.animation.fox.move
playanimation @e[type=fox,tag=item] animation.creeper.swelling none 0 “
v.scale=0.205;
v.adscale=math.sqrt(v.scale);
v.adscaled=2.1385*v.adscale;
v.xbasepos=0;
v.ybasepos=-0.9;
v.zbasepos=-1.2;
v.xpos=0;
v.ypos=7.4+1.7*math.sin(q.life_time*118);
v.zpos=0;
v.xrot=90;
v.yrot=q.life_time*-57;
v.zrot=-25;
v.swelling_scale1=v.adscaled;
v.swelling_scale2=v.adscaled;
” scale
playanimation @e[type=fox,tag=item] animation.ender_dragon.neck_head_movement none 0 “
v.adjust_xz=8*v.adscaled+v.zbasepos/v.adscaled;
v.adjust_y=(-5-v.ybasepos/v.adscaled/v.adscaled)*v.adscaled;
v.x=v.xbasepos/v.adscaled;
v.y=v.adjust_y;
v.z=v.adjust_xz;
v.ty=v.y*math.cos(v.xrot)-v.z*math.sin(v.xrot);
v.tz=v.y*math.sin(v.xrot)+v.z*math.cos(v.xrot);
v.y=v.ty;
v.z=v.tz;
v.tx=-v.x*math.cos(v.zrot)+v.y*math.sin(v.zrot);
v.ty=v.x*math.sin(v.zrot)+v.y*math.cos(v.zrot);
v.x=v.tx;
v.y=v.ty;
v.tx=v.x*math.cos(v.yrot)+v.z*math.sin(v.yrot);
v.tz=-v.x*math.sin(v.yrot)+v.z*math.cos(v.yrot);
v.x=v.tx;
v.z=v.tz;
v.head_position_x=v.x+v.xpos/v.adscaled;
v.head_position_y=7.48/v.adscale+v.z+v.zpos/v.adscaled;
v.head_position_z=v.y-v.ypos/v.adscaled;
v.head_rotation_x=90+v.xrot;
v.head_rotation_y=v.zrot;
v.head_rotation_z=v.yrot;
” posrot
コメント
すみません。
サッカーボールの当たり判定がおかしいです。
コマンドはコピペしてるのであってるはずですが…
修正しました。
v.head_position_y=7.48/v.adscale+v.z-v.xpos/v.adscaled-v.world_delta_x*7.8;
の部分です。
switch対応版もお願いします!
(あとYouTubeなどで紹介させていただいてもいいでしょうか?)
FMBE全般ではなくこのコマンド(サッカー、フェイクアイテムなど)のことなら、rog_omegaの名を記載していただければ大丈夫です。
Switch対応版書いときます。
ありがとうございます
コメント失礼します
サッカーのコマンドを使用したのですがぶつかっても小刻みに震えるだけで動かないです
最初のコマンドはインパルス、あとはチェーンであっていますか?
キツネは-61が地面のブロックなら、-59.6くらいの高さに召喚してtagを付ければ動作するはずです。
コマンドブロックの数はサッカーを含め6個です。
あと、どのブロックも「playanimation」から始まるので間違えがないか確認してみてください。
本人ではないので、うまくいくかは分かりません…
少しでもお役に立てたらうれしいです!
狐をtpで固定していない可能性があるのでtpで固定してください。
きつねのもっているアイテムの変え方を教えてほしいです
/replaceitem entity @e[type=fox] slot.weapon.mainhand 0 アイテムID
でできます。
ありがとうございます
こまんどを試してみて、実際に物理法則はうまくいったのですが視点を動かすとブロックの表示が消えるのですがわかる方いたら教えてほしいです。
キツネ本体が視野から見えなくなると、ボールも消えます。
マイクラの使用なのでしょうがないです…
質問です、モンハンの焼ける肉って作れます?
エラーが出ます
サッカーボールでエラーが出ます
コマンドをコピペして使うとこうなるのですが何故でしょうか?当たり判定も変です。