Compare commits

...
Author SHA1 Message Date
jackowes 09eb3395c0 <temp and broken> add beginnings of recurring sound function 2025-08-18 21:42:26 -05:00
jackowes 48d289279a add char tests 2025-08-14 20:42:50 -05:00
2 changed files with 33 additions and 0 deletions
@@ -326,6 +326,31 @@ abstract class PosableState : Schedulable {
}
}
}
.addFunction("recurring_sound") { params ->
if (params.get<MoValue>(0) !is StringValue) {
return@addFunction Unit
}
//param 0 - sound
//param 1 - offset
//param 2 -
val curr_time = reusableAnimTime.value
val entity = getEntity()
val soundEvent = SoundEvent.createVariableRangeEvent(params.getString(0).asIdentifierDefaultingNamespace())
val offset = params.getDouble(1)
val loopLength = params.getDouble(2)
if (soundEvent != null) {
val volume = 1F
val pitch = 1F
if( )
if (entity != null) {
if (!entity.isSilent) {
entity.level().playLocalSound(entity, soundEvent, entity.soundSource, volume, pitch)
}
} else {
Minecraft.getInstance().soundManager.play(SimpleSoundInstance.forUI(soundEvent, volume, pitch))
}
}
}
.addFunction("render_item") { params ->
if (params.get<MoValue>(0) !is StringValue) return@addFunction Unit
@@ -17503,6 +17503,10 @@
"3.1667": {
"effect": "animation.leather.wing_flap.medium"
}
},
"timeline": {
"1.125": "q.has_entity ? { q.sound('animation.chitin.wing_flap.medium'); };",
"3.1667": "q.has_entity ? { q.particle('cobblemon:ambient_shiny_sparkle', 'root'); };"
}
},
"animation.charizard.air_fly": {
@@ -18791,6 +18795,10 @@
"3.0833": {
"effect": "animation.leather.wing_flap.medium"
}
},
"timeline": {
"1.0833": "q.particle('cobblemon:ambient_shiny_sparkle', 'root');",
"3.0833": "q.sound('animation.chitin.wing_flap.medium');"
}
},
"animation.charizard.air_glide_TEST": {