Minecraft Wiki
m (interwiki,zh has started using this template)
(26 intermediate revisions by 13 users not shown)
Line 1: Line 1:
 
{{documentation header}}
 
{{documentation header}}
  +
{{lua}}
 
<!-- Documentation here -->
 
<!-- Documentation here -->
{{Sound table|?|?|?|?|?|?|?|?|?|foot=1}}
 
   
A template that automatically generates a table for sounds.
+
A template that automatically generates a table for sounds.<br>
  +
{{edition|java}} table:
 
{{Sound table|nocat=1|foot=1}}
  +
{{edition|bedrock}} table:
  +
{{Sound table|nocat=1|foot=1|bedrock=1}}
  +
{{edition|dungeons}} table:
  +
{{Sound table|nocat=1|foot=1|dungeons=1}}
   
 
== Arguments ==
 
== Arguments ==
Line 10: Line 16:
 
! Function
 
! Function
 
|-
 
|-
  +
| <code>bedrock</code> || Inserting a table for Bedrock, which is just no subtitle, source and attenuation distance, and renames preload to load on low memory, ''if defined'' '''has''' to be defined in the '''first''' call.
| <code>1</code> || The sound(s).
 
 
|-
 
|-
  +
| <code>dungeons</code> || Inserting a table for Dungeons, which is only sounds, description and ID (header renamed to File), ''if defined'' '''has''' to be defined in the '''first''' call.
| <code>2</code> || The subtitle.
 
 
|-
 
|-
| <code>3</code> || The sound category (slider in the sounds menu).
+
| <code>nocat</code> || Stops table from inserting categories, ''if defined'' '''has''' to be defined in the '''first''' call.
 
|-
 
|-
| <code>4</code> || When the sound plays.
+
| <code>sound</code> || The sound, set to "-" if none in this event.
 
|-
 
|-
| <code>5</code> || The sound event/namespaced ID (code formatting automatically added).
+
| <code>sound2</code> - <code>sound20</code> || Additional sounds.
 
|-
 
|-
| <code>6</code> || The subtitle key/translation key (code formatting automatically added).
+
| <code>subtitle</code> || The subtitle, set to "-" if none in this event.
 
|-
 
|-
| <code>7</code> || The sound volume.
+
| <code>source</code> || The sound category (slider in the sounds menu).
 
|-
 
|-
| <code>8</code> || The sound pitch.
+
| <code>description</code> || When the sound plays. Defaults to the subtitle, if it is provided.
 
|-
 
|-
| <code>9</code> || The sound attenuation distance.
+
| <code>id</code> || The sound event/namespaced ID (code formatting automatically added).
 
|-
 
|-
  +
| <code>translationkey</code> || The subtitle key/translation key (code formatting automatically added), set to "-" if none in this event.
| <code>foot</code> || Inserting the table end.
 
  +
|-
  +
| <code>volume</code> || The volume the game plays this sound event at.
  +
|-
 
| <code>pitch</code> || The pitch the game plays this sound event at.
  +
|-
  +
| <code>distance</code> || The attenuation distance the game plays this sound event at.
  +
|-
  +
| <code>soundvolume</code> || The volume per-sound as defined in {{code|sounds.json}} or {{code|sound_definitions.json}}.
  +
|-
  +
| <code>soundpitch</code> || The pitch per-sound as defined in {{code|sounds.json}} or {{code|sound_definitions.json}}.
  +
|-
  +
| <code>sounddistance</code> || The attenuation distance per-sound as defined in {{code|sounds.json}} or {{code|sound_definitions.json}}.
  +
|-
  +
| <code>soundstream</code> || The stream value per-sound as defined in {{code|sounds.json}} or {{code|sound_definitions.json}}.
  +
|-
  +
| <code>soundpreload</code> || The preload/load-on-low-memory value per-sound as defined in {{code|sounds.json}} or {{code|sound_definitions.json}}.
  +
|-
 
| <code>foot</code> || Inserting the table end, '''always has''' to be defined in the '''last''' call.
 
|}
 
|}
   
  +
== Predefined tables ==
  +
* [[:Template:Sound table/Block|Block category]]
  +
* [[:Template:Sound table/Entity|Entity category]]
   
 
<includeonly>
 
<includeonly>
 
<!-- Template categories/interwiki here -->
 
<!-- Template categories/interwiki here -->
  +
[[Category:Table templates]]
  +
  +
[[es:Plantilla:Sound table]]
  +
[[ja:テンプレート:Sound table]]
 
[[pt:Predefinição:Tabela de áudio]]
 
[[pt:Predefinição:Tabela de áudio]]
  +
[[ru:Шаблон:Таблица звука]]
  +
[[uk:Шаблон:Звукова таблиця]]
  +
[[zh:Template:Sound table]]
 
</includeonly>
 
</includeonly>
 
<noinclude>
 
<noinclude>
 
<!-- Documentation categories/interwiki here -->
 
<!-- Documentation categories/interwiki here -->
  +
[[es:Plantilla:Sound table]]
  +
[[ja:テンプレート:Sound table/doc]]
 
[[pt:Predefinição:Tabela de áudio/doc]]
 
[[pt:Predefinição:Tabela de áudio/doc]]
  +
[[ru:Шаблон:Таблица звука/док]]
  +
[[uk:Шаблон:Звукова таблиця/док]]
  +
[[zh:Template:Sound table/doc]]
 
</noinclude>
 
</noinclude>

Revision as of 09:55, 26 December 2020

This is the documentation page. It should be transcluded into the main template page. See Template:Documentation for more information
Lua logo
This template uses Module:Sound table, a script written in Lua.

A template that automatically generates a table for sounds.
Java Edition table:

SoundSubtitlesSourceDescriptionResource locationTranslation keyVolumePitchAttenuation
distance
?????????

Bedrock Edition table:

SoundSourceDescriptionResource locationVolumePitch
??????

Minecraft Dungeons table:

SoundDescription
??

Arguments

Parameter Function
bedrock Inserting a table for Bedrock, which is just no subtitle, source and attenuation distance, and renames preload to load on low memory, if defined has to be defined in the first call.
dungeons Inserting a table for Dungeons, which is only sounds, description and ID (header renamed to File), if defined has to be defined in the first call.
nocat Stops table from inserting categories, if defined has to be defined in the first call.
sound The sound, set to "-" if none in this event.
sound2 - sound20 Additional sounds.
subtitle The subtitle, set to "-" if none in this event.
source The sound category (slider in the sounds menu).
description When the sound plays. Defaults to the subtitle, if it is provided.
id The sound event/namespaced ID (code formatting automatically added).
translationkey The subtitle key/translation key (code formatting automatically added), set to "-" if none in this event.
volume The volume the game plays this sound event at.
pitch The pitch the game plays this sound event at.
distance The attenuation distance the game plays this sound event at.
soundvolume The volume per-sound as defined in sounds.json or sound_definitions.json.
soundpitch The pitch per-sound as defined in sounds.json or sound_definitions.json.
sounddistance The attenuation distance per-sound as defined in sounds.json or sound_definitions.json.
soundstream The stream value per-sound as defined in sounds.json or sound_definitions.json.
soundpreload The preload/load-on-low-memory value per-sound as defined in sounds.json or sound_definitions.json.
foot Inserting the table end, always has to be defined in the last call.

Predefined tables