-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathRecordComponent.php
More file actions
39 lines (32 loc) · 1.14 KB
/
RecordComponent.php
File metadata and controls
39 lines (32 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
declare(strict_types=1);
namespace customiesdevs\customies\item\component;
final class RecordComponent implements ItemComponent {
private int $comparatorSignal;
private float $duration;
private string $soundEvent;
/**
* Record Component used by record items to play music.
* @param int $comparatorSignal Specifies signal strength for comparator blocks to use, from 1 - 13
* @param float $duration Specifies duration of sound event in seconds, float value
* @param string $soundEvent Sound event type: 13, cat, blocks, chirp, far, mall, mellohi, stal, strad, ward, 11, wait, pigstep, otherside, 5, relic
*/
public function __construct(float $duration, int $comparatorSignal = 1, string $soundEvent = "undefined") {
$this->comparatorSignal = $comparatorSignal;
$this->duration = $duration;
$this->soundEvent = $soundEvent;
}
public function getName(): string {
return "minecraft:record";
}
public function getValue(): array {
return [
"comparator_signal" => $this->comparatorSignal,
"duration" => $this->duration,
"sound_event" => $this->soundEvent
];
}
public function isProperty(): bool {
return false;
}
}