Skip to content

ResourcePack

Namespace Mc.Scripting · Kind class (sealed)

public sealed class ResourcePack : IEquatable<ResourcePack>

A resource pack the server asks clients to download.

Member Description
Constructor A resource pack the server asks clients to download.
public ResourcePack(Uuid Id, string Url, string? Sha1 = null, bool Required = false, Component? Prompt = null)

A resource pack the server asks clients to download.

Parameters

Name Type Description
Id Uuid The pack id (clients keep one pack per id: pushing the same id replaces it).
Url string The download address (http or https).
Sha1 string? = null The SHA-1 hash of the zip as 40 hex characters; null skips the check (clients then re-download on every push).
Required bool = false Whether the client is disconnected when it declines the pack.
Prompt Component? = null Text shown in the download prompt, null for the default.
Member Description
Uuid Id { get; init; } The pack id (clients keep one pack per id: pushing the same id replaces it).
Component? Prompt { get; init; } Text shown in the download prompt, null for the default.
bool Required { get; init; } Whether the client is disconnected when it declines the pack.
string? Sha1 { get; init; } The SHA-1 hash of the zip as 40 hex characters; null skips the check (clients then re-download on every push).
string Url { get; init; } The download address (http or https).
public Uuid Id { get; init; }

The pack id (clients keep one pack per id: pushing the same id replaces it).

public Component? Prompt { get; init; }

Text shown in the download prompt, null for the default.

public bool Required { get; init; }

Whether the client is disconnected when it declines the pack.

public string? Sha1 { get; init; }

The SHA-1 hash of the zip as 40 hex characters; null skips the check (clients then re-download on every push).

public string Url { get; init; }

The download address (http or https).

Member Description
FromUrl Creates a pack whose id is derived from its url, so pushing the same url twice replaces the first push.
public static ResourcePack FromUrl(string url, string? sha1 = null, bool required = false, Component? prompt = null)

Creates a pack whose id is derived from its url, so pushing the same url twice replaces the first push.

Parameters

Name Type Description
url string The download address.
sha1 string? = null The SHA-1 hash (40 hex characters).
required bool = false Whether declining disconnects the client.
prompt Component? = null Text shown in the prompt.

Returns ResourcePack

Component · Uuid