var bool=false;
var id=new Array();
var data=new Array();
var count=new Array();
var armor=new Array();
var damage=new Array();
var exp;
var level;
var sm=0;
function newLevel(){
clientMessage("欢迎使用黑小制作实用JS死亡不掉落");
}
function deathHook(a,e){
if(e!=getPlayerEnt())
return;
id=[];
data=[];
count=[];
armor=[];
damage=[];
bool=true;
for(i=0;i<45;i++){
id.push(Player.getInventorySlot(i));
data.push(Player.getInventorySlotData(i));
count.push(Player.getInventorySlotCount(i));
Player.clearInventorySlot(i);}
for(i=0;i<4;i++){
armor.push(Player.getArmorSlot(i));
damage.push(Player.getArmorSlotDamage(i));
Player.setArmorSlot(i,0);}}
function modTick(){
if(bool==true&&Entity.getHealth(getPlayerEnt())>0){
bool=false;
for(i=0;i<45;i++)
Player.addItemInventory(id[i],count[i],data[i]);
for(i=0;i<4;i++)
Player.setArmorSlot(i,armor[i],damage[i]);}
if(Entity.getHealth(getPlayerEnt())>0){
if(sm>0){
sm=0
Player.setExp(exp)
Player.setLevel(level)
}
exp=Player.getExp()
level=Player.getLevel()
}
if(Entity.getHealth(getPlayerEnt())<=0.025){
sm++
}
}




















