Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 89 additions & 1 deletion kubejs/data/trofers/trophies.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,93 @@
"name": "entity.ars_nouveau.wilden_stalker",
"accent_color": "#6b6348",
"effects": {"sound": {"id": "ars_nouveau:ignis_death"}}
},
"archevoker": {
"folder": "irons_spellbooks",
"entity": "irons_spellbooks:archevoker",
"name": "entity.irons_spellbooks.archevoker",
"accent_color": "#2e2235",
"effects": {"sound": {"id": "ars_nouveau:ignis_death"}},
"tag": {
"HandItems": [{"count": 1, "id": "irons_spellbooks:evoker_spell_book"},{}],
"ArmorItems": [
{ "count": 1, "id": "irons_spellbooks:archevoker_boots" },
{ "count": 1, "id": "irons_spellbooks:archevoker_leggings" },
{ "count": 1, "id": "irons_spellbooks:archevoker_chestplate" },
{ "count": 1, "id": "irons_spellbooks:archevoker_helmet" }
]
}
},
"cryomancer": {
"folder": "irons_spellbooks",
"entity": "irons_spellbooks:cryomancer",
"name": "entity.irons_spellbooks.cryomancer",
"accent_color": "#fafafa",
"effects": {"sound": {"id": "ars_nouveau:ignis_death"}},
"tag": {
"HandItems": [{"count": 1, "id": "irons_spellbooks:ice_staff"},{}],
"ArmorItems": [
{ "count": 1, "id": "irons_spellbooks:cryomancer_boots" },
{ "count": 1, "id": "irons_spellbooks:cryomancer_leggings" },
{ "count": 1, "id": "irons_spellbooks:cryomancer_chestplate" },
{ "count": 1, "id": "irons_spellbooks:cryomancer_helmet" }
]
}
},
"pyromancer": {
"folder": "irons_spellbooks",
"entity": "irons_spellbooks:pyromancer",
"name": "entity.irons_spellbooks.pyromancer",
"accent_color": "#570001",
"effects": {"sound": {"id": "ars_nouveau:ignis_death"}},
"tag": {
"HandItems": [{"count": 1, "id": "irons_spellbooks:pyrium_staff"},{}],
"ArmorItems": [
{ "count": 1, "id": "irons_spellbooks:pyromancer_boots" },
{ "count": 1, "id": "irons_spellbooks:pyromancer_leggings" },
{ "count": 1, "id": "irons_spellbooks:pyromancer_chestplate" },
{ "count": 1, "id": "irons_spellbooks:pyromancer_helmet" }
]
}
},
"priest": {
"folder": "irons_spellbooks",
"entity": "irons_spellbooks:priest",
"name": "entity.irons_spellbooks.priest",
"accent_color": "#2e2235",
"effects": {"sound": {"id": "ars_nouveau:ignis_death"}},
"tag": {
"HandItems": [{"count": 1, "id": "irons_spellbooks:graybeard_staff"},{}],
"ArmorItems": [
{ "count": 1, "id": "irons_spellbooks:priest_boots" },
{ "count": 1, "id": "irons_spellbooks:priest_leggings" },
{ "count": 1, "id": "irons_spellbooks:priest_chestplate" },
{ "count": 1, "id": "irons_spellbooks:priest_helmet" }
]
}
},
"necromancer": {
"folder": "irons_spellbooks",
"entity": "irons_spellbooks:necromancer",
"name": "entity.irons_spellbooks.necromancer",
"accent_color": "#442f23",
"effects":{"sound":{"id": "ars_nouveau:ignis_death"}},
"tag":{ "ArmorItems": [{},{},{},{"count": 1, "id": "irons_spellbooks:tarnished_helmet"}]}
},
"ancient_knight": {
"folder": "irons_spellbooks",
"entity": "irons_spellbooks:citadel_keeper",
"name": "entity.irons_spellbooks.citadel_keeper",
"accent_color": "#593f50",
"effects":{"sound":{"id": "ars_nouveau:ignis_death"}},
"tag":{"HandItems": [{"count": 1, "id": "irons_spellbooks:keeper_flamberge"},{}]}
},
"apothecarist": {
"folder": "irons_spellbooks",
"entity": "irons_spellbooks:apothecarist",
"name": "entity.irons_spellbooks.apothecarist",
"accent_color": "#593f50",
"effects":{"sound":{"id": "ars_nouveau:ignis_death"}},
"tag":{"ArmorItems":[{},{},{"count": 1, "id":"irons_spellbooks:plagued_chestplate"},{}]}
}
}
}
23 changes: 23 additions & 0 deletions kubejs/server_scripts/beheading.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
EntityEvents.death("player", (event) => {
//console.log("player morto");

let { entity, source } = event;

//console.log(`tentativo di drop: minecraft:player_head[minecraft:profile="${entity.name.string}"]`);

//dropchance in percentage
let dropChance = 0.5

// console.log("UCCISORE:" + source.getType());
let attacker = source.actual;

// Controlla se la causa della morte è un altro giocatore
if (attacker.isPlayer() && Math.random() < dropChance) {
let myEntity = event.level.createEntity('item');
myEntity.item = Item.of(`minecraft:player_head[minecraft:profile="${entity.name.string}"]`);
myEntity.x = entity.x;
myEntity.y = entity.y;
myEntity.z = entity.z;
myEntity.spawn();
}
});
59 changes: 58 additions & 1 deletion kubejs/server_scripts/trophies.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,31 @@ ServerEvents.generateData('after_mods', event => {
trophy_base: 'trofers:small_plate',
};


/**

JSON temeplate

"": {
"folder": "",
"entity": "mod:nome",
"name": "entity.mod.nome",
"accent_color": "#ffffff",
"effects": {"sound": {"id": "ars_nouveau:ignis_death"}},
"nbt": "{OnGround:1b,Act:1,Phase:0}",
"display": {"scale": 0.25, "offset":[0.0, 0.0, 2.0]},
"tag": {
"HandItems": [{"count": 1, "id": "irons_spellbooks:pyrium_staff"},{}],
"ArmorItems": [
{ "count": 1, "id": "irons_spellbooks:archevoker_boots" },
{ "count": 1, "id": "irons_spellbooks:archevoker_leggings" },
{ "count": 1, "id": "irons_spellbooks:archevoker_chestplate" },
{ "count": 1, "id": "irons_spellbooks:archevoker_helmet" }
]
}
}

*/
// Loop su ogni trofeo
Object.entries(trophies).forEach(([id, data]) => {
// Creiamo un nome univoco e valido per il trofeo
Expand Down Expand Up @@ -63,14 +88,46 @@ ServerEvents.generateData('after_mods', event => {
trophy.effects = data.effects;
}

if(data.tag){
trophy.entity.tag = data.tag;
}

// Salva il JSON nella cartella trofei di Trofers, usando il nome univoco
event.json(`trofers:trofers/trophies/${trophy_name}`, trophy);

// Aggiungi il trofeo alla lista dei drop, usando il nome univoco
drops.trophies[data.entity] = `trofers:trophies/${trophy_name}`;
drops.trophies[data.entity] = `trofers:${trophy_name}`;
});


// Scrivo il file completo per tutti i mob Cataclysm
event.json('trofers:trofers/entity_drops/mod_drops', drops);
});

// add a description on how the trophies are dropped
// I only added it on the generic small plate that is the one that normally drops
RecipeViewerEvents.addInformation('item', event => {
event.add('trofers:small_plate', [
'Each enemy has a low chance of dropping its trophy upon death.'
]);
})

// added all the recipe for plate conversion in the stonecutter
ServerEvents.recipes(event => {
const trophies = JsonIO.read('kubejs/data/trofers/trophies.json');

Object.entries(trophies).forEach(([id, data]) => {
const trophy_name = `${data.folder}/${id}`;

const trophy_type = ['small_plate','small_pillar','medium_plate','medium_pillar','large_plate','large_pillar'];

trophy_type.forEach(input => {
trophy_type.forEach(output => {
if(input!=output){
event.stonecutting(`trofers:${input}[trofers:trophy="trofers:${trophy_name}"]`, `trofers:${output}[trofers:trophy="trofers:${trophy_name}"]`);
}
});
});
});

});