Skip to content

Commit

Permalink
Merge pull request SerenityOS#14 from AnyBananaGAME/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
PMK744 committed Mar 28, 2024
2 parents 79d3b91 + 734f17f commit 32d6bc8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/world/src/components/entity/meta/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ export * from "./has-gravity";
export * from "./breathing";
export * from "./nametag";
export * from "./always-show-nametag";
export * from "./scale"
29 changes: 29 additions & 0 deletions packages/world/src/components/entity/meta/scale.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { MetadataKey, MetadataType } from "@serenityjs/protocol";

import { Entity } from "../../../entity";

import { EntityMetadataComponent } from "./meta";

class EntityScaleComponent extends EntityMetadataComponent {
public readonly flag = false;

public readonly key = MetadataKey.Scale;

public readonly type = MetadataType.Float;

public defaultValue = 1;

public currentValue = this.defaultValue;

/**
* Set a custom scale for your entity (Width and Height)
*
* @param entity The entity the component is binded to.
* @returns A new entity scale component
*/
public constructor(entity: Entity) {
super(entity, "minecraft:scale");
}
}

export { EntityScaleComponent };

0 comments on commit 32d6bc8

Please sign in to comment.